{
int ret;
char *diffValue;
+
+ diffValue = NULL;
ret =
GNUNET_CONFIGURATION_get_value_string (cbData->cfgDiffs, section,
option, &diffValue);
}
else
cbData->status = 1;
+ GNUNET_free_non_null (diffValue);
break;
}
#if DEBUG
GNUNET_CONFIGURATION_set_value_string (diffsCB.cfgDiffs,
"new-section", key,
"new-value");
+ GNUNET_free (key);
}
break;
}
initDiffsCBData (&cbData);
cfg = GNUNET_CONFIGURATION_create ();
- GNUNET_CONFIGURATION_load (cfg, NULL);
+ /* load defaults */
+ GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (cfg, NULL));
/* Modify configuration and save it */
cfgDiffs = editConfiguration (cfg, option);
diffsFileName =
GNUNET_DISK_mktemp ("gnunet-test-configurations-diffs.conf");
+ if (diffsFileName == NULL)
+ return 1;
GNUNET_CONFIGURATION_write_diffs (cfgDefault, cfg, diffsFileName);
GNUNET_CONFIGURATION_destroy (cfg);
cbData.callBackOption = COMPARE;
cbData.cfgDiffs = cfgDiffs;
GNUNET_CONFIGURATION_iterate (cfg, diffsCallBack, &cbData);
- if ((ret = cbData.status) == 1)
+ if (1 == (ret = cbData.status))
{
fprintf (stderr,
"Incorrect Configuration Diffs: Diffs may contain data not actually edited\n");
#endif
GNUNET_CONFIGURATION_destroy (cfg);
GNUNET_CONFIGURATION_destroy (cfgDiffs);
+ GNUNET_free (diffsFileName);
return ret;
}
{
int ok = 1 + 2 + 4 + 8;
char *fn;
+ char *pfx;
pid_t pid;
char *const argv[] = { "test-resolver-api",
"-c",
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
+ pfx = GNUNET_OS_installation_get_path(GNUNET_OS_IPK_BINDIR);
GNUNET_asprintf(&fn, "%s%cgnunet-service-resolver",
- GNUNET_OS_installation_get_path(GNUNET_OS_IPK_BINDIR),
+ pfx,
DIR_SEPARATOR);
+ GNUNET_free (pfx);
pid = GNUNET_OS_start_process (fn,
"gnunet-service-resolver",
#if VERBOSE