www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: [PATCH] Add comment indicating a resource leak is not really a resource leak

[PATCH] Add comment indicating a resource leak is not really a resource leak

From: Steven Dake <sdake_at_redhat.com>
Date: Tue, 6 Mar 2012 00:27:43 -0700

While possibly obvious to those investigating the code, coverity complains
about this out of scope leak.

Signed-off-by: Steven Dake <sdake_at_redhat.com>

---
 src/openssl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/openssl.c b/src/openssl.c
index db95b12..7d686a1 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -217,6 +217,10 @@ static int
 aes_ctr_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
              const unsigned char *iv, int enc) /* init key */
 {
+    /*
+     * variable "c" is leaked from this scope, but is later freed 
+     * in aes_ctr_cleanup
+     */
     aes_ctr_ctx *c = malloc(sizeof(*c));
     const EVP_CIPHER *aes_cipher;
     (void) enc;
-- 
1.7.7.6
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-03-06

the libssh2 team