sim: Handle an error condition better

This commit is contained in:
Denis Kenzior 2011-03-15 20:51:28 -05:00
parent 9c2af56c18
commit 788a91402e
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}