From 788a91402e472976aebf68456816b121958acc26 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 15 Mar 2011 20:51:28 -0500 Subject: sim: Handle an error condition better --- src/sim.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/sim.c b/src/sim.c index 46e63f4b..98d4cc40 100644 --- a/src/sim.c +++ b/src/sim.c @@ -1285,14 +1285,15 @@ static void sim_efimg_read_cb(int ok, int length, int record, if (sim->efimg == NULL) { sim->efimg = g_try_malloc0(num_records * 9); - if (sim->efimg == NULL) return; sim->iidf_watch_ids = g_try_new0(unsigned int, num_records); - - if (sim->iidf_watch_ids == NULL) + if (sim->iidf_watch_ids == NULL) { + g_free(sim->efimg); + sim->efimg = NULL; return; + } sim->efimg_length = num_records * 9; } -- cgit v1.2.3