This patch provides a minor fix for the hameg-hmo driver: use the
appropriate glib function to free memory (byte array).

--- libsigrok-git-20102018-orig/src/hardware/hameg-hmo/protocol.c       
2018-10-20 13:12:30.895966966 +0200
+++ 
libsigrok-git-20102018-use-g_byte_array_free/src/hardware/hameg-hmo/protocol.c  
    2018-10-23 21:44:26.969267074 +0200
@@ -881,7 +881,6 @@ SR_PRIV int hmo_receive_data(int fd, int
                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
                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;
                }
 


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to