From: Uwe Hermann Date: Sat, 19 May 2018 19:58:10 +0000 (+0200) Subject: siglent-sds: Fix multiple scan-build warnings. X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=b4580cb9d069594e561d79b4fc3d53aaff246f90;p=libsigrok.git siglent-sds: Fix multiple scan-build warnings. 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); ^~~~~~~~~~~ --- diff --git a/src/hardware/siglent-sds/api.c b/src/hardware/siglent-sds/api.c index 018f68dd..cd77590f 100644 --- a/src/hardware/siglent-sds/api.c +++ b/src/hardware/siglent-sds/api.c @@ -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;