X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=parsers.c;h=6f47e61de26e289160014a6d772b4b7d35f6937c;hp=2dbbd930095be243ef5fc71d44af31857ad58b35;hb=f81faab0eaf03aeea6476112f0f4e91fee709efc;hpb=350beb4bff20be4fd766715a75d69989f301ede3 diff --git a/parsers.c b/parsers.c index 2dbbd93..6f47e61 100644 --- a/parsers.c +++ b/parsers.c @@ -33,7 +33,9 @@ char **parse_probestring(int max_probes, const char *probestring) error = FALSE; range = NULL; - probelist = g_malloc0(max_probes * sizeof(char *)); + if (!(probelist = g_try_malloc0(max_probes * sizeof(char *)))) { + /* TODO: Handle errors. */ + } tokens = g_strsplit(probestring, ",", max_probes); for (i = 0; tokens[i]; i++) { @@ -167,7 +169,7 @@ struct sr_device *parse_devicestring(const char *devicestring) plugin = p->data; if (strcmp(plugin->name, devicestring)) continue; - num_devices = sr_init_hwplugins(plugin); + num_devices = sr_init_hwplugin(plugin); if (num_devices == 1) { devices = sr_device_list(); device = devices->data;