]> git.droids-corp.org - protos/libecoli.git/commitdiff
fix double free
authorOlivier Matz <zer0@droids-corp.org>
Thu, 29 Nov 2018 19:16:14 +0000 (20:16 +0100)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 29 Nov 2018 19:16:54 +0000 (20:16 +0100)
libecoli_yaml/ecoli_yaml.c

index 76592e272df166199933bed99b0ee811aaa852c8..84007d55b96a756ff1d3f8c60b38b1bc908eff62 100644 (file)
@@ -217,6 +217,7 @@ parse_ec_config(struct enode_table *table,
                if (enode == NULL)
                        goto fail;
                config = ec_config_node(enode);
+               enode = NULL;
                if (config == NULL) {
                        fprintf(stderr, "Failed to create config\n");
                        goto fail;
@@ -450,9 +451,11 @@ parse_ec_node(struct enode_table *table,
                goto fail;
 
        if (ec_node_set_config(enode, config) < 0) {
+               config = NULL; /* freed */
                fprintf(stderr, "Failed to set config\n");
                goto fail;
        }
+       config = NULL; /* freed */
 
        if (help != NULL) {
                if (ec_keyval_set(ec_node_attrs(enode), "help", help,