]> sigrok.org Git - libsigrok.git/commitdiff
beaglelogic: No need to check g_free() argument.
authorUwe Hermann <redacted>
Tue, 26 Sep 2017 17:44:01 +0000 (19:44 +0200)
committerUwe Hermann <redacted>
Tue, 26 Sep 2017 17:51:55 +0000 (19:51 +0200)
glib's g_free() function will gracefully handle NULL as input.

src/hardware/beaglelogic/api.c

index 024c668138346167f6e56e0a0a75d4bb33ac4162..5527dcea46a28354e6fc984a740e406cba9101ed 100644 (file)
@@ -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)