aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2017-03-08 19:33:18 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2017-03-10 11:41:34 +0100
commitce375f2a396c4735a12e9105595d7c9f1a366abb (patch)
tree3f557523a61b4d52748994e81f7e4ba80111a000
parent5801ce7840c72775fbcfaf39e0587f767f070efd (diff)
sr_usbtmc_dev_inst_free(): Allow NULL as argument.
-rw-r--r--src/device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index a8f6f2b..d87d290 100644
--- a/src/device.c
+++ b/src/device.c
@@ -489,6 +489,9 @@ SR_PRIV struct sr_usbtmc_dev_inst *sr_usbtmc_dev_inst_new(const char *device)
/** @private */
SR_PRIV void sr_usbtmc_dev_inst_free(struct sr_usbtmc_dev_inst *usbtmc)
{
+ if (!usbtmc)
+ return;
+
g_free(usbtmc->device);
g_free(usbtmc);
}