From 1bdf68e133419144306edd39068f3354628a94c4 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 22 Sep 2010 22:39:29 -0500 Subject: simfs: Fix freeing a NULL queue --- src/simfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/simfs.c b/src/simfs.c index abd94e94..b5b12b48 100644 --- a/src/simfs.c +++ b/src/simfs.c @@ -93,8 +93,10 @@ void sim_fs_free(struct sim_fs *fs) * Note: users of sim_fs must not assume that the callback happens * for operations still in progress */ - g_queue_foreach(fs->op_q, (GFunc)sim_fs_op_free, NULL); - g_queue_free(fs->op_q); + if (fs->op_q) { + g_queue_foreach(fs->op_q, (GFunc)sim_fs_op_free, NULL); + g_queue_free(fs->op_q); + } g_free(fs); } -- cgit v1.2.3