We are a bit too aggressive about freeing memory in strv mode. Only
free it in the case that we actually set the pointer to NULL.
Uncovered by the GApplication tests.
if (perform_nulls)
{
- if (context->strv_mode)
- g_free (*n->ptr);
-
if (n->value)
{
/* Copy back the short options */
strcpy (*n->ptr + 1, n->value);
}
else
- *n->ptr = NULL;
+ {
+ if (context->strv_mode)
+ g_free (*n->ptr);
+
+ *n->ptr = NULL;
+ }
}
g_free (n->value);