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
1 changed files with 3 additions and 2 deletions

View File

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