hp-3457a: free memory that was allocated by SCPI get routines

The SCPI get routines may allocate memory for response data which
callers have to free after use.

This addresses part of bug #1683.
This commit is contained in:
Gerhard Sittig 2021-05-16 14:43:58 +02:00
parent c9cfcd2591
commit 1c50255506
1 changed files with 3 additions and 1 deletions

View File

@ -138,8 +138,10 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
if ((ret != SR_OK) || !response) if ((ret != SR_OK) || !response)
return NULL; return NULL;
if (strcmp(response, "HP3457A")) if (strcmp(response, "HP3457A")) {
g_free(response);
return NULL; return NULL;
}
g_free(response); g_free(response);