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:
parent
f8eb3531a4
commit
4042ebe3d1
3
search.c
3
search.c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user