summaryrefslogtreecommitdiffstats
path: root/webservice.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-25 13:38:18 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-25 13:38:18 -0800
commit31b2a6ffa839ad107706516e166f13b0b88bae08 (patch)
treebc866e756ffa4dcda39ff1196e7c8f4ac1a392fc /webservice.c
parenta635c30564ecaccbbaf3420025419d9c6080d4bd (diff)
downloadsubsurface-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.c2
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) {