handle allocation failure in the previous commit
This commit is contained in:
parent
bd133697fd
commit
13314369a5
@ -1494,10 +1494,14 @@ static int command(void)
|
|||||||
lptr++;
|
lptr++;
|
||||||
if (!SKIPPING) {
|
if (!SKIPPING) {
|
||||||
char *usermsg=(char*)malloc(strlen(lptr)+1);
|
char *usermsg=(char*)malloc(strlen(lptr)+1);
|
||||||
|
if(usermsg!=NULL) {
|
||||||
strcpy(usermsg,lptr);
|
strcpy(usermsg,lptr);
|
||||||
usermsg[strcspn(usermsg,"\r\n")]='\0';
|
usermsg[strcspn(usermsg,"\r\n")]='\0';
|
||||||
error(237,usermsg); /* user warning */
|
error(237,usermsg); /* user warning */
|
||||||
free(usermsg);
|
free(usermsg);
|
||||||
|
} else {
|
||||||
|
error(237,lptr);
|
||||||
|
} /* if */
|
||||||
} /* if */
|
} /* if */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user