diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-10-25 12:55:31 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-10-28 13:08:11 +0200 |
commit | e5b6aa60519ec44014198f54b4a95aa2d958c14a (patch) | |
tree | 017ae6a888392b8cd80920e86ba247f30994b5a8 | |
parent | 347cbdbbf9c79bef01b5e8ca51cc2868525074a2 (diff) | |
download | pianobar-e5b6aa60519ec44014198f54b4a95aa2d958c14a.tar.gz pianobar-e5b6aa60519ec44014198f54b4a95aa2d958c14a.tar.bz2 pianobar-e5b6aa60519ec44014198f54b4a95aa2d958c14a.zip |
Fix memleaks
PianoDestroyRequests overwrites the content of responseData. We have to
free it before that.
-rw-r--r-- | src/ui.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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"); |