]> sigrok.org Git - libsigrok.git/commitdiff
siglent-sds: Fix multiple scan-build warnings.
authorUwe Hermann <redacted>
Sat, 19 May 2018 19:58:10 +0000 (21:58 +0200)
committerUwe Hermann <redacted>
Sat, 19 May 2018 20:01:28 +0000 (22:01 +0200)
  src/hardware/siglent-sds/api.c:596:3: warning: Argument to g_free() is the address of a global variable, which is not memory allocated by malloc()
                  g_free(cmd);
                  ^~~~~~~~~~~
  src/hardware/siglent-sds/api.c:641:3: warning: Argument to g_free() is the address of a global variable, which is not memory allocated by malloc()
                  g_free(cmd);
                  ^~~~~~~~~~~

src/hardware/siglent-sds/api.c

index 018f68dd80dd9dff94e93a8cc9c43904f00b6bd4..cd77590f493f466f67dc17d68a2666af48dc5bb6 100644 (file)
@@ -531,7 +531,7 @@ static int config_set(uint32_t key, GVariant *data,
        int ret, idx;
        const char *tmp_str;
        char buffer[16];
-       char *cmd = "";
+       char *cmd = NULL;
        char cmd4[4];
 
        devc = sdi->priv;