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>
This commit is contained in:
Dirk Hohndel 2013-02-25 13:38:18 -08:00
parent a635c30564
commit 31b2a6ffa8

View file

@ -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) {