summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2010-10-25 12:55:31 +0200
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2010-10-28 13:08:11 +0200
commite5b6aa60519ec44014198f54b4a95aa2d958c14a (patch)
tree017ae6a888392b8cd80920e86ba247f30994b5a8 /src/ui.c
parent347cbdbbf9c79bef01b5e8ca51cc2868525074a2 (diff)
downloadpianobar-windows-e5b6aa60519ec44014198f54b4a95aa2d958c14a.tar.gz
pianobar-windows-e5b6aa60519ec44014198f54b4a95aa2d958c14a.tar.bz2
pianobar-windows-e5b6aa60519ec44014198f54b4a95aa2d958c14a.zip
Fix memleaks
PianoDestroyRequests overwrites the content of responseData. We have to free it before that.
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c4
1 files changed, 2 insertions, 2 deletions
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");