Skip to contentSkip to conversation

Use obstack_zalloc when allocating tag

PATCH New Masatake YAMATO 1 participant 1 message Jun 18, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use obstack_zalloc when allocating tag

obstack_alloc was used in __tag__alloc to allocate tag object. As the result some fields of the tag object are not initialized.

---
 dwarf_loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dwarf_loader.c +1 -1
index d7709a0..bc04b62 100644
@@ -369,7 +369,7 @@ static void *__tag__alloc(struct dwarf_cu *dcu, size_t size, bool spec)
 	if (dtag == NULL)
 		return NULL;
 
-	struct tag *tag = obstack_alloc(&dcu->cu->obstack, size);
+	struct tag *tag = obstack_zalloc(&dcu->cu->obstack, size);
 
 	if (tag == NULL)
 		return NULL;
Signature · 6 lines
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html