sr_usbtmc_dev_inst_free(): Allow NULL as argument.

This commit is contained in:
Uwe Hermann 2017-03-08 19:33:18 +01:00
parent 5801ce7840
commit ce375f2a39
1 changed files with 3 additions and 0 deletions

View File

@ -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);
}