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:
parent
951ee95a30
commit
b963c5cb38
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue