summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2013-02-25 11:35:08 +0100
committerPali Rohár <pali.rohar@gmail.com>2013-02-25 11:35:08 +0100
commit5c90f39f6e71b1d3d64e094b63e05ee102870a8e (patch)
tree4e390b7a980f2c49d598cc7e6236e3f6c51cb8e4
parent5ca1e0c899de92d1ebbedb0e0c83efc4c3a3e6a8 (diff)
download0xFFFF-5c90f39f6e71b1d3d64e094b63e05ee102870a8e.tar.bz2
image: Do not call image_free on NULL pointer
-rw-r--r--src/image.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c
index 994e3d0..c5f93a2 100644
--- a/src/image.c
+++ b/src/image.c
@@ -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;