X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhwdriver.c;h=db3f615afecec7d1dbe470fd10ce0282f402c0e4;hb=2c4600191b8442a64717f048c6a77ef77d6169ff;hp=b31242ad7799dec7aef83d974bce5372b16f7e2b;hpb=050eb3b32d96a7c0a54dee9ae249514eff937d21;p=libsigrok.git diff --git a/src/hwdriver.c b/src/hwdriver.c index b31242ad..db3f615a 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -586,6 +586,7 @@ static void log_key(const struct sr_dev_inst *sdi, { const char *opstr; const struct sr_key_info *srci; + gchar *tmp_str; /* Don't log SR_CONF_DEVICE_OPTIONS, it's verbose and not too useful. */ if (key == SR_CONF_DEVICE_OPTIONS) @@ -594,9 +595,11 @@ static void log_key(const struct sr_dev_inst *sdi, opstr = op == SR_CONF_GET ? "get" : op == SR_CONF_SET ? "set" : "list"; srci = sr_key_info_get(SR_KEY_CONFIG, key); + tmp_str = g_variant_print(data, TRUE); sr_spew("sr_config_%s(): key %d (%s) sdi %p cg %s -> %s", opstr, key, srci ? srci->id : "NULL", sdi, cg ? cg->name : "NULL", - data ? g_variant_print(data, TRUE) : "NULL"); + data ? tmp_str : "NULL"); + g_free(tmp_str); } static int check_key(const struct sr_dev_driver *driver,