Skip to contentSkip to conversation

libxl_json: remove extra "break"

PATCH In review Wei Liu 3 participants 5 messages Apr 9, 2014 – May 22, 2014

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 libxl_json: remove extra "break"

... otherwise JSON array elements are not freed and memory is leaked.

---
 tools/libxl/libxl_json.c |    1 -
 1 file changed, 1 deletion(-)
tools/libxl/libxl_json.c +0 -1
index d2f7de8..989ac3f 100644
@@ -285,7 +285,6 @@ void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj)
     }
     case JSON_ARRAY: {
         libxl__json_object *node = NULL;
-        break;
 
         for (idx = 0; idx < obj->u.array->count; idx++) {
             if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 1 line · Wei Liu

... otherwise JSON array elements are not freed and memory is leaked.

How exciting!

Quoted 1 line

I assume this isn't a recent issue so this should be a candidate for backporting.

Quoted 16 lines
---
 tools/libxl/libxl_json.c |    1 -
 1 file changed, 1 deletion(-)
tools/libxl/libxl_json.c +0 -1
index d2f7de8..989ac3f 100644
@@ -285,7 +285,6 @@ void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj)
     }
     case JSON_ARRAY: {
         libxl__json_object *node = NULL;
-        break;
 
         for (idx = 0; idx < obj->u.array->count; idx++) {
             if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
author
#2 lore raw
Quoted 12 lines · Ian Campbell
Quoted 1 line · Wei Liu

... otherwise JSON array elements are not freed and memory is leaked.

How exciting!

Quoted 1 line

I assume this isn't a recent issue so this should be a candidate for backporting.

4.2 onwards contains this bug.

Wei.

#3 lore raw

Wei Liu writes ("Re: [PATCH] libxl_json: remove extra "break""):

Quoted 6 lines · Ian Campbell
Quoted 5 lines · Wei Liu
Quoted 1 line

... otherwise JSON array elements are not freed and memory is leaked.

How exciting!

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

I assume this isn't a recent issue so this should be a candidate for backporting.

4.2 onwards contains this bug.

Thanks. I have applied this and added it to my backport list.

Ian.

#4 lore raw

Ian Jackson writes ("Re: [PATCH] libxl_json: remove extra "break""):

Quoted 4 lines

Wei Liu writes ("Re: [PATCH] libxl_json: remove extra "break""):

Quoted 1 line

4.2 onwards contains this bug.

Thanks. I have applied this and added it to my backport list.

Backported to 4.4, 4.3, 4.2. Will push soon.

Ian.