]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Do a NULL check bit yearlier, before we actually try to deref the
authorMaksym Sobolyev <sobomax@sippysoft.com>
Mon, 27 Oct 2014 17:57:05 +0000 (10:57 -0700)
committerMaksym Sobolyev <sobomax@sippysoft.com>
Mon, 27 Oct 2014 17:57:05 +0000 (10:57 -0700)
pointer. Otherwise we might segfault in certain conditions.

src/rrd_graph_helper.c

index 69d379b44ba69abee025e7cebb27a62d61f62fcf..03eaccf9ef48086145c1e4cd5244f5a035177a15 100644 (file)
@@ -878,10 +878,10 @@ int parse_def(enum gf_en gf,parsedargs_t*pa,image_desc_t *const im){
                                        |PARSE_END
                                        |PARSE_REDUCE
                                        ); 
+  if (!gdp) { return 1;}
   if (gdp->step == 0){
       gdp->step = im->step; /* initialize with image wide step */
   }  
-  if (!gdp) { return 1;}
   /* debugging output */
   dprintf("=================================\n");
   dprintf("DEF   : %s\n",pa->arg_orig);