diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-06 18:45:03 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-01-01 14:50:25 -0800 |
commit | ffe60c0f58ae4b385ad733fad4455efaebdd1342 (patch) | |
tree | 74df96937360c26b8d2e148dcab23a861a2e6e52 /parse.c | |
parent | 37371f1cdcf351e29bf542e6b2fc269b29a4fba2 (diff) |
Make malloc error checking/reporting more consistent
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -367,6 +367,8 @@ define2(const char *name, const char *val, struct inclist *file) name, (*sp)->s_value, val, file->i_file)); free((*sp)->s_value); (*sp)->s_value = strdup(val); + if ((*sp)->s_value == NULL) + fatalerr("strdup() failure in %s()\n", __func__); return; } @@ -383,6 +385,8 @@ define2(const char *name, const char *val, struct inclist *file) debug(1, ("defining %s to %s in file %s\n", name, val, file->i_file)); stab->s_name = strdup(name); stab->s_value = strdup(val); + if ((stab->s_name == NULL) || (stab->s_value == NULL)) + fatalerr("strdup() failure in %s()\n", __func__); *sp = stab; } |