[pacman-dev] [PATCH 1/3] lib/libalpm/signing.c: Fix memory leak in decode_signature() in case of error.

Diogo Sousa diogogsousa at gmail.com
Sat Aug 27 17:03:45 EDT 2011


Signed-off-by: Diogo Sousa <diogogsousa at gmail.com>
---
 lib/libalpm/signing.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 8db4a7b..67f7adf 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -175,6 +175,7 @@ static int decode_signature(const char *base64_data,
 	size_t destlen = len * 3 / 4;
 	MALLOC(*data, destlen, goto error);
 	if(base64_decode(*data, &destlen, usline, len)) {
+		free(*data);
 		goto error;
 	}
 	*data_len = destlen;
-- 
1.7.6.1



More information about the pacman-dev mailing list