Skip to contentSkip to conversation

chunkd: fix duplicate stc_object allocation in stc_parse_key()

PATCH In review Akinobu Mita 2 participants 2 messages Mar 16, 2010 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 chunkd: fix duplicate stc_object allocation in stc_parse_key()

At the beginning of stc_parse_key(), st_object is allocated twice for the same variable.

---
 lib/chunkdc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/chunkdc.c +1 -1
index 2696a81..67c39eb 100644
@@ -831,7 +831,7 @@ void stc_free_keylist(struct st_keylist *keylist)
 static void stc_parse_key(xmlDocPtr doc, xmlNode *node,
 			  struct st_keylist *keylist)
 {
-	struct st_object *obj = calloc(1, sizeof(*obj));
+	struct st_object *obj;
 	xmlChar *xs;
 
 	obj = calloc(1, sizeof(*obj));
Signature · 1 line
1.6.5.5
#1 lore raw
Quoted 7 lines · Akinobu Mita

At the beginning of stc_parse_key(), st_object is allocated twice for the same variable.

---
  lib/chunkdc.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

good catch, applied