1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-18 07:16:23 -05:00

Fix CID 39916: potential dereference of Null pointer.

This commit is contained in:
Renaud 2015-03-24 11:57:10 +08:00
parent f8eb3531a4
commit 4042ebe3d1

View File

@ -1377,10 +1377,11 @@ static int rmcstr(void)
if ((rmcptr->rstr = malloc(mj + 1)) == NULL) { if ((rmcptr->rstr = malloc(mj + 1)) == NULL) {
mloutstr( "%Out of memory") ; mloutstr( "%Out of memory") ;
status = FALSE; status = FALSE;
} } else {
strncpy(rmcptr->rstr, patptr - mj, mj); strncpy(rmcptr->rstr, patptr - mj, mj);
rmcptr++; rmcptr++;
} }
}
rmcptr->mc_type = MCNIL; rmcptr->mc_type = MCNIL;
return status; return status;