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:
Guido Trentalancia 2018-11-16 18:38:54 +01:00 committed by Uwe Hermann
parent 4fff7b3c8a
commit 14cb6aa40a
1 changed files with 2 additions and 2 deletions

View File

@ -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 (data)
g_byte_array_free(data, TRUE);
return TRUE;
}
@ -927,7 +926,8 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
break;
case SR_CHANNEL_LOGIC:
if (sr_scpi_get_block(sdi->conn, NULL, &data) != SR_OK) {
g_free(data);
if (data)
g_byte_array_free(data, TRUE);
return TRUE;
}