From 51dfd2c93ded26db5820201a1e43ed8e3cdb7d99 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 18 Jan 2013 13:12:35 -0500 Subject: [PATCH] LP#1101254: remove memory leak in HTTP translator Signed-off-by: Galen Charlton Signed-off-by: Bill Erickson --- src/gateway/osrf_http_translator.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.11.0