Fix allocation problem.

This commit is contained in:
Vreixo Formoso 2008-04-05 17:08:17 +02:00
parent 7b0da1ecd6
commit ccc7b0b58f
1 changed files with 2 additions and 2 deletions

View File

@ -2136,7 +2136,7 @@ int image_builder_create_node(IsoNodeBuilder *builder, IsoImage *image,
free(name); free(name);
return ret; return ret;
} }
link = malloc(sizeof(IsoSymlink)); link = calloc(1, sizeof(IsoSymlink));
if (link == NULL) { if (link == NULL) {
free(name); free(name);
return ISO_OUT_OF_MEM; return ISO_OUT_OF_MEM;
@ -2154,7 +2154,7 @@ int image_builder_create_node(IsoNodeBuilder *builder, IsoImage *image,
{ {
/* source is an special file */ /* source is an special file */
IsoSpecial *special; IsoSpecial *special;
special = malloc(sizeof(IsoSpecial)); special = calloc(1, sizeof(IsoSpecial));
if (special == NULL) { if (special == NULL) {
free(name); free(name);
return ISO_OUT_OF_MEM; return ISO_OUT_OF_MEM;