mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Added missing malloc failure checks
This commit is contained in:
8
obj.c
8
obj.c
@@ -571,9 +571,13 @@ defineobject(char *name, int indices[], int count)
|
||||
}
|
||||
|
||||
oap = (OBJECTACTIONS *) malloc(objectactionsize(count));
|
||||
if (oap == NULL) {
|
||||
math_error("Cannot allocate object type #0");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
name = addstr(hp, name);
|
||||
if ((oap == NULL) || (name == NULL)) {
|
||||
math_error("Cannot allocate object type");
|
||||
if (name == NULL) {
|
||||
math_error("Cannot allocate object type #1");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
oap->oa_count = count;
|
||||
|
Reference in New Issue
Block a user