memory leak bug fix for fko_new() to allow multiple calls without requiring external...
authorMichael Rash <mbr@cipherdyne.org>
Thu, 21 Feb 2013 12:36:33 +0000 (07:36 -0500)
committerMichael Rash <mbr@cipherdyne.org>
Thu, 21 Feb 2013 13:36:29 +0000 (08:36 -0500)
lib/fko_funcs.c

index f43018f..15df6cd 100644 (file)
@@ -160,6 +160,9 @@ fko_new(fko_ctx_t *r_ctx)
 
     FKO_SET_CTX_INITIALIZED(ctx);
 
+    if(r_ctx != NULL)
+        fko_destroy(*r_ctx);
+
     *r_ctx = ctx;
 
     return(FKO_SUCCESS);