PR: 1813
authorDr. Stephen Henson <steve@openssl.org>
Sat, 27 Mar 2010 18:28:02 +0000 (18:28 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sat, 27 Mar 2010 18:28:02 +0000 (18:28 +0000)
Submitted by: Torsten Hilbrich <torsten.hilbrich@secunet.com>

Fix memory leak when engine name cannot be loaded.

crypto/engine/eng_list.c

index 66a52b89e0c174d5acf1dfbdcfc66faf86b29631..27846edb1e9a4c7540ce3e6b0bfa17e8358951a3 100644 (file)
@@ -413,6 +413,7 @@ ENGINE *ENGINE_by_id(const char *id)
                return iterator;
                }
 notfound:
+       ENGINE_free(iterator);
        ENGINEerr(ENGINE_F_ENGINE_BY_ID,ENGINE_R_NO_SUCH_ENGINE);
        ERR_add_error_data(2, "id=", id);
        return NULL;