target/image: fix undefined behaviour when loading with GDB
The image struct is malloc'd and hence base_address_set doesn't have a defined value. Caught by Valgrind. Change-Id: Ice15b2299fc768e44e8034eeb93e035076eacd03 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2524 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>__archive__
parent
7f000f824b
commit
c8d351b1bf
|
@ -788,6 +788,7 @@ int image_open(struct image *image, const char *url, const char *type_string)
|
||||||
}
|
}
|
||||||
} else if (image->type == IMAGE_BUILDER) {
|
} else if (image->type == IMAGE_BUILDER) {
|
||||||
image->num_sections = 0;
|
image->num_sections = 0;
|
||||||
|
image->base_address_set = 0;
|
||||||
image->sections = NULL;
|
image->sections = NULL;
|
||||||
image->type_private = NULL;
|
image->type_private = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue