From: Uwe Hermann Date: Thu, 26 Mar 2015 20:51:37 +0000 (+0100) Subject: Don't check g_free() arguments for NULL. X-Git-Tag: sigrok-cli-0.6.0~34 X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=commitdiff_plain;h=ad92a2b3072fadfcda1c19c03a27a8fe76984383 Don't check g_free() arguments for NULL. The g_free() call is guaranteed to not segfault when NULL is passed. --- diff --git a/decode.c b/decode.c index cadd5ea..4d584d7 100644 --- a/decode.c +++ b/decode.c @@ -198,8 +198,7 @@ int register_pds(const char *opt_pds, char *opt_pd_annotations) g_hash_table_destroy(options); if (channels) g_hash_table_destroy(channels); - if (pd_name) - g_free(pd_name); + g_free(pd_name); return ret; } diff --git a/session.c b/session.c index 30e0825..86eea7c 100644 --- a/session.c +++ b/session.c @@ -332,8 +332,7 @@ void datafeed_in(const struct sr_dev_inst *sdi, if (o) { sr_output_free(o); - if (srzip_and_filename) - g_free(srzip_and_filename); + g_free(srzip_and_filename); } o = NULL;