diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-02-25 13:38:18 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-02-25 13:38:18 -0800 |
commit | 31b2a6ffa839ad107706516e166f13b0b88bae08 (patch) | |
tree | bc866e756ffa4dcda39ff1196e7c8f4ac1a392fc /webservice.c | |
parent | a635c30564ecaccbbaf3420025419d9c6080d4bd (diff) | |
download | subsurface-31b2a6ffa839ad107706516e166f13b0b88bae08.tar.gz |
Fix uninitialized memory access in webservice download
In download_dialog_release_xml() we check if state->xmldata is non-NULL
and free it. But we don't set it to NULL anywhere, so if the user hits
cancel the variable is undefined.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'webservice.c')
-rw-r--r-- | webservice.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/webservice.c b/webservice.c index f3def9f14..d52d480ec 100644 --- a/webservice.c +++ b/webservice.c @@ -218,7 +218,7 @@ void webservice_download_dialog(void) const gchar *current_uid = subsurface_get_conf("webservice_uid"); GtkWidget *dialog, *vbox, *status, *info, *uid; GtkWidget *frame_uid, *frame_status, *download, *image, *apply; - struct download_dialog_state *state = malloc(sizeof(struct download_dialog_state)); + struct download_dialog_state *state = calloc(1, sizeof(struct download_dialog_state)); gboolean has_previous_uid = TRUE; if (!current_uid) { |