image: Do not call image_free on NULL pointer

This commit is contained in:
Pali Rohár committed 2013-02-25 11:35:08 +01:00
1 parent 5ca1e0c899
commit 5c90f39f6e
1 file changed
+3
+3
View File
@@ -305,6 +305,9 @@ struct image * image_alloc_from_shared_fd(int fd, size_t size, size_t offset, ui
void image_free(struct image * image) {
if ( ! image )
return;
if ( ! image->is_shared_fd ) {
close(image->fd);
image->fd = -1;