check for failure after call to calloc() (issue #8295)
authorRussell Bryant <russell@russellbryant.com>
Mon, 6 Nov 2006 18:05:11 +0000 (18:05 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 6 Nov 2006 18:05:11 +0000 (18:05 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47232 65c4cc65-6c06-0410-ace0-fbb531ad65f3

utils/check_expr.c

index 531af49..85b869b 100644 (file)
@@ -69,6 +69,8 @@ char *find_var(const char *varname) /* the list should be pretty short, if there
 void set_var(const char *varname, const char *varval)
 {
        struct varz *t = calloc(1,sizeof(struct varz));
+       if (!t)
+               return;
        strcpy(t->varname, varname);
        strcpy(t->varval, varval);
        t->next = global_varlist;