diff options
-rw-r--r-- | apps/rehash.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/rehash.c b/apps/rehash.c index 7fe01de11c..ae91654fe9 100644 --- a/apps/rehash.c +++ b/apps/rehash.c @@ -168,6 +168,12 @@ static int add_entry(enum Type type, unsigned int hash, const char *filename, *ep = nilhentry; ep->old_id = ~0; ep->filename = OPENSSL_strdup(filename); + if (ep->filename == NULL) { + OPENSSL_free(ep); + ep = NULL; + BIO_printf(bio_err, "out of memory\n"); + return 1; + } if (bp->last_entry) bp->last_entry->next = ep; if (bp->first_entry == NULL) |