image: Do not call image_free on NULL pointer
This commit is contained in:
1 parent
5ca1e0c899
commit
5c90f39f6e
1 file changed
+3
@@ -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) {
|
void image_free(struct image * image) {
|
||||||
|
|
||||||
|
if ( ! image )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( ! image->is_shared_fd ) {
|
if ( ! image->is_shared_fd ) {
|
||||||
close(image->fd);
|
close(image->fd);
|
||||||
image->fd = -1;
|
image->fd = -1;
|
||||||
|
|||||||
Reference in new issue
Block a user