piano: Fix memory leak pointed out by clang

from upstream git
This commit is contained in:
dcoppa 2012-09-23 10:18:21 +00:00
parent 4d3e30f0c1
commit 2128820f04
2 changed files with 24 additions and 4 deletions

View File

@ -1,10 +1,11 @@
# $OpenBSD: Makefile,v 1.45 2012/09/18 12:35:03 dcoppa Exp $
# $OpenBSD: Makefile,v 1.46 2012/09/23 10:18:21 dcoppa Exp $
SHARED_ONLY = Yes
COMMENT = console client for pandora
DISTNAME = pianobar-2012.09.07
REVISION = 0
EXTRACT_SUFX = .tar.bz2
CATEGORIES = audio

View File

@ -1,10 +1,13 @@
$OpenBSD: patch-src_libpiano_crypt_c,v 1.4 2012/07/06 08:32:13 dcoppa Exp $
$OpenBSD: patch-src_libpiano_crypt_c,v 1.5 2012/09/23 10:18:21 dcoppa Exp $
Work around libgcrypt deprecation warnings. See:
http://lists.gnupg.org/pipermail/gcrypt-devel/2011-July/001830.html
--- src/libpiano/crypt.c.orig Fri Jul 6 10:09:40 2012
+++ src/libpiano/crypt.c Fri Jul 6 10:10:24 2012
Fix memory leak pointed out by clang
(upstream git commit fe1ffbd7257b4c0dd43a825912bcd65732df6db2)
--- src/libpiano/crypt.c.orig Fri Sep 7 16:44:39 2012
+++ src/libpiano/crypt.c Sun Sep 23 12:11:36 2012
@@ -23,7 +23,9 @@ THE SOFTWARE.
#include <string.h>
@ -15,3 +18,19 @@ http://lists.gnupg.org/pipermail/gcrypt-devel/2011-July/001830.html
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
@@ -57,6 +59,7 @@ char *PianoDecryptString (gcry_cipher_hd_t h, const ch
gret = gcry_cipher_decrypt (h, output, outputLen, NULL, 0);
if (gret) {
+ free (output);
return NULL;
}
@@ -82,6 +85,7 @@ char *PianoEncryptString (gcry_cipher_hd_t h, const ch
gret = gcry_cipher_encrypt (h, paddedInput, paddedInputLen, NULL, 0);
if (gret) {
+ free (paddedInput);
return NULL;
}