From: Galen Charlton Date: Fri, 18 Jan 2013 18:12:35 +0000 (-0500) Subject: LP#1101254: remove memory leak in HTTP translator X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=51dfd2c93ded26db5820201a1e43ed8e3cdb7d99;p=working%2FOpenSRF.git LP#1101254: remove memory leak in HTTP translator Signed-off-by: Galen Charlton Signed-off-by: Bill Erickson --- diff --git a/src/gateway/osrf_http_translator.c b/src/gateway/osrf_http_translator.c index 2fed04a..f829fa0 100644 --- a/src/gateway/osrf_http_translator.c +++ b/src/gateway/osrf_http_translator.c @@ -331,7 +331,11 @@ static char* osrfHttpTranslatorParseRequest(osrfHttpTranslator* trans) { } } - return osrfMessageSerializeBatch(msgList, numMsgs); + char* jsonString = osrfMessageSerializeBatch(msgList, numMsgs); + for(i = 0; i < numMsgs; i++) { + osrfMessageFree(msgList[i]); + } + return jsonString; } static int osrfHttpTranslatorCheckStatus(osrfHttpTranslator* trans, transport_message* msg) {