graph_list.c: Improve error handling in one little case.
authorFlorian Forster <ff@octo.it>
Mon, 14 Jun 2010 15:53:20 +0000 (17:53 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 14 Jun 2010 15:53:20 +0000 (17:53 +0200)
graph_list.c

index fc63620..80fab28 100644 (file)
@@ -183,6 +183,12 @@ static graph_instance_t *instance_create (graph_config_t *cfg, /* {{{ */
 
   i->select = ident_copy_with_selector (cfg->select, file,
       IDENT_FLAG_REPLACE_ANY);
+  if (i->select == NULL)
+  {
+    DEBUG ("instance_create: ident_copy_with_selector returned NULL.\n");
+    free (i);
+    return (NULL);
+  }
 
   i->files = NULL;
   i->files_num = 0;