image.c: clear image variable

Not zeroing the image after talloc occasionally leads to a segfault because
the programme thinks it has a signature when in reality it just has a junk
pointer and segfaults.

Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
James Bottomley 2013-04-11 21:12:17 -07:00
parent 951ee95a30
commit b963c5cb38

View file

@ -401,6 +401,7 @@ struct image *image_load(const char *filename)
return NULL;
}
memset(image, 0, sizeof(*image));
rc = fileio_read_file(image, filename, &image->buf, &image->size);
if (rc)
goto err;