diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-02-09 21:29:57 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-02-09 11:39:42 -0800 |
commit | 3848cac30f3b7cd96d8add37fc3576f2ff00093e (patch) | |
tree | 12cfe73d7f0a8614707c3932f46dcb56532b5fe3 | |
parent | 2af818bf918a4d07aedf6cc17b5783a2c964b506 (diff) | |
download | subsurface-3848cac30f3b7cd96d8add37fc3576f2ff00093e.tar.gz |
Fixed a memory leak in webservice.c
webservice.c:webservice_download_dialog()
If a value for previous UID is returned from the user config
via subsurface_get_conf("webservice_uid"), make sure to
free the string near the function return.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | webservice.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webservice.c b/webservice.c index fec2ccf2d..531a571c3 100644 --- a/webservice.c +++ b/webservice.c @@ -199,10 +199,13 @@ void webservice_download_dialog(void) GtkWidget *dialog, *vbox, *status, *info, *uid; GtkWidget *frame_uid, *frame_status, *download, *image, *apply; struct download_dialog_state state = {NULL}; + gboolean has_previous_uid = TRUE; int result; - if (!current_uid) + if (!current_uid) { current_uid = ""; + has_previous_uid = FALSE; + } dialog = gtk_dialog_new_with_buttons(_("Download From Web Service"), GTK_WINDOW(main_window), @@ -262,4 +265,6 @@ void webservice_download_dialog(void) } download_dialog_release_xml(&state); gtk_widget_destroy(dialog); + if (has_previous_uid) + free((void *)current_uid); } |