From 7dfc4c9ed511c058b0ac47826742aec7b5175ecd Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Thu, 29 Nov 2018 20:16:14 +0100 Subject: [PATCH] fix double free --- libecoli_yaml/ecoli_yaml.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libecoli_yaml/ecoli_yaml.c b/libecoli_yaml/ecoli_yaml.c index 76592e2..84007d5 100644 --- a/libecoli_yaml/ecoli_yaml.c +++ b/libecoli_yaml/ecoli_yaml.c @@ -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, -- 2.39.5