diff options
-rw-r--r-- | libflashrom.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libflashrom.c b/libflashrom.c index d66c2959..5f14c681 100644 --- a/libflashrom.c +++ b/libflashrom.c @@ -361,6 +361,9 @@ size_t flashrom_flash_getsize(const struct flashrom_flashctx *const flashctx) */ void flashrom_flash_release(struct flashrom_flashctx *const flashctx) { + if (!flashctx) + return; + flashrom_layout_release(flashctx->default_layout); free(flashctx->chip); free(flashctx); |