From ce375f2a396c4735a12e9105595d7c9f1a366abb Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 8 Mar 2017 19:33:18 +0100 Subject: [PATCH] sr_usbtmc_dev_inst_free(): Allow NULL as argument. --- src/device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/device.c b/src/device.c index a8f6f2b4..d87d2904 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); }