hameg-hmo: Use g_byte_array_free() instead of g_free().
Use the appropriate glib function to free memory (byte array). This fixes bug #1324.
This commit is contained in:
parent
4fff7b3c8a
commit
14cb6aa40a
|
@ -881,7 +881,6 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
|
||||||
if (sr_scpi_get_block(sdi->conn, NULL, &data) != SR_OK) {
|
if (sr_scpi_get_block(sdi->conn, NULL, &data) != SR_OK) {
|
||||||
if (data)
|
if (data)
|
||||||
g_byte_array_free(data, TRUE);
|
g_byte_array_free(data, TRUE);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -927,7 +926,8 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
|
||||||
break;
|
break;
|
||||||
case SR_CHANNEL_LOGIC:
|
case SR_CHANNEL_LOGIC:
|
||||||
if (sr_scpi_get_block(sdi->conn, NULL, &data) != SR_OK) {
|
if (sr_scpi_get_block(sdi->conn, NULL, &data) != SR_OK) {
|
||||||
g_free(data);
|
if (data)
|
||||||
|
g_byte_array_free(data, TRUE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue