rigol-dg: 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. Move an existing release call to an earlier location, to avoid leaking memory when an error path is taken. This addresses part of bug #1683.
This commit is contained in:
parent
36165cf0f7
commit
ff85a7f0ab
|
@ -780,6 +780,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
|||
devc->counter_enabled = TRUE;
|
||||
else
|
||||
devc->counter_enabled = FALSE;
|
||||
g_free(response);
|
||||
|
||||
if (!devc->counter_enabled) {
|
||||
/*
|
||||
|
@ -834,8 +835,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
|
|||
}
|
||||
}
|
||||
|
||||
g_free(response);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue