summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/cbfstool/cbfs_image.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/cbfstool/cbfs_image.c b/util/cbfstool/cbfs_image.c
index b9d5f28486..12bc2fe74e 100644
--- a/util/cbfstool/cbfs_image.c
+++ b/util/cbfstool/cbfs_image.c
@@ -300,6 +300,9 @@ int cbfs_image_write_file(struct cbfs_image *image, const char *filename)
int cbfs_image_delete(struct cbfs_image *image)
{
+ if (image == NULL)
+ return 0;
+
buffer_delete(&image->buffer);
image->header = NULL;
return 0;