Skip to contentSkip to conversation

Fix: Undefined behavior of double free on strlist in get_names_args

PATCH Mathieu Desnoyers 1 participant 1 message Feb 28, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 11 lines · * Christian Babeux ([email protected]) wrote:
---
 converter/babeltrace.c | 1 +
 1 file changed, 1 insertion(+)
converter/babeltrace.c +0 -0
index 20ded00..28c63cb 100644

converter/babeltrace.c static int get_names_args(poptContext *pc) · line 208

Quoted 4 lines
converter/babeltrace.c +1 -0
@@ -205,6 +205,7 @@ static int get_names_args(poptContext *pc)
 		} else {
 			fprintf(stderr, "[error] unknown field name type %s\n", str);
 			free(strlist);
+			strlist = NULL;

could we just remove the free(strlist), and just have:

   ret = -EINVAL;
   goto end;

instead ?

Thanks,

Mathieu

Quoted 6 lines
converter/babeltrace.c +0 -0
 			ret = -EINVAL;
 			goto end;
 		}
Signature · 1 line
1.8.1.3
Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com