From e5b6aa60519ec44014198f54b4a95aa2d958c14a Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 25 Oct 2010 12:55:31 +0200 Subject: Fix memleaks PianoDestroyRequests overwrites the content of responseData. We have to free it before that. --- src/ui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ui.c') diff --git a/src/ui.c b/src/ui.c index 33829c4..480dc83 100644 --- a/src/ui.c +++ b/src/ui.c @@ -139,10 +139,10 @@ int BarUiPianoCall (BarApp_t * const app, PianoRequestType_t type, *wRet = BarPianoHttpRequest (&app->waith, &req); if (*wRet != WAITRESS_RET_OK) { BarUiMsg (MSG_NONE, "Network error: %s\n", WaitressErrorToStr (*wRet)); - PianoDestroyRequest (&req); if (req.responseData != NULL) { free (req.responseData); } + PianoDestroyRequest (&req); return 0; } @@ -176,10 +176,10 @@ int BarUiPianoCall (BarApp_t * const app, PianoRequestType_t type, } } else if (*pRet != PIANO_RET_OK) { BarUiMsg (MSG_NONE, "Error: %s\n", PianoErrorToStr (*pRet)); - PianoDestroyRequest (&req); if (req.responseData != NULL) { free (req.responseData); } + PianoDestroyRequest (&req); return 0; } else { BarUiMsg (MSG_NONE, "Ok.\n"); -- cgit v1.2.3