g_strsplit() returns a newly-allocated NULL-terminated array of strings.
g_strfreev() must be used to free it, once it is no longer needed.
The probe 'names' were not freed properly, causing a "definitely lost" memory
leak.
Call g_strfreev(names) to properly free the memory.
Signed-off-by: Alexandru Gagniuc <redacted>
ret = SR_OK;
range = NULL;
+ names = NULL;
probelist = NULL;
tokens = g_strsplit(probestring, ",", 0);
for (i = 0; tokens[i]; i++) {
if (range)
g_strfreev(range);
+ if (names)
+ g_strfreev(names);
+
if (ret != SR_OK) {
g_slist_free(probelist);
probelist = NULL;