From a5670bb87456390a0b5dd8de687793a7f980d492 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juho=20V=C3=A4h=C3=A4-Herttua?= Date: Thu, 22 Mar 2012 10:31:32 +0200 Subject: [PATCH] Fix a small memory leak in raop_buffer. --- src/lib/raop_buffer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/raop_buffer.c b/src/lib/raop_buffer.c index 7869d1d..38995c2 100644 --- a/src/lib/raop_buffer.c +++ b/src/lib/raop_buffer.c @@ -72,20 +72,21 @@ static int get_fmtp_info(ALACSpecificConfig *config, const char *fmtp) { int intarr[12]; + char *original; char *strptr; int i; /* Parse fmtp string to integers */ - strptr = strdup(fmtp); + original = strptr = strdup(fmtp); for (i=0; i<12; i++) { if (strptr == NULL) { - free(strptr); + free(original); return -1; } intarr[i] = atoi(utils_strsep(&strptr, " ")); } - free(strptr); - strptr = NULL; + free(original); + original = strptr = NULL; /* Fill the config struct */ config->frameLength = intarr[1]; -- 2.34.1