From: Uwe Hermann Date: Tue, 26 Sep 2017 17:44:01 +0000 (+0200) Subject: beaglelogic: No need to check g_free() argument. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=00f2e9bc6b97649d16a4407f26ebf5514fd634c0;p=libsigrok.git beaglelogic: No need to check g_free() argument. glib's g_free() function will gracefully handle NULL as input. --- diff --git a/src/hardware/beaglelogic/api.c b/src/hardware/beaglelogic/api.c index 024c6681..5527dcea 100644 --- a/src/hardware/beaglelogic/api.c +++ b/src/hardware/beaglelogic/api.c @@ -215,14 +215,9 @@ static int dev_close(struct sr_dev_inst *sdi) static void clear_helper(struct dev_context *devc) { - if (devc->tcp_buffer) - g_free(devc->tcp_buffer); - - if (devc->address) - g_free(devc->address); - - if (devc->port) - g_free(devc->port); + g_free(devc->tcp_buffer); + g_free(devc->address); + g_free(devc->port); } static int dev_clear(const struct sr_dev_driver *di)