[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r9629 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r9629 - gnunet/src/util |
Date: |
Sun, 22 Nov 2009 12:06:55 -0700 |
Author: grothoff
Date: 2009-11-22 12:06:54 -0700 (Sun, 22 Nov 2009)
New Revision: 9629
Modified:
gnunet/src/util/test_configuration.c
gnunet/src/util/test_resolver_api.c
Log:
fixes
Modified: gnunet/src/util/test_configuration.c
===================================================================
--- gnunet/src/util/test_configuration.c 2009-11-22 18:37:41 UTC (rev
9628)
+++ gnunet/src/util/test_configuration.c 2009-11-22 19:06:54 UTC (rev
9629)
@@ -117,6 +117,8 @@
{
int ret;
char *diffValue;
+
+ diffValue = NULL;
ret =
GNUNET_CONFIGURATION_get_value_string (cbData->cfgDiffs, section,
option, &diffValue);
@@ -127,6 +129,7 @@
}
else
cbData->status = 1;
+ GNUNET_free_non_null (diffValue);
break;
}
#if DEBUG
@@ -180,6 +183,7 @@
GNUNET_CONFIGURATION_set_value_string (diffsCB.cfgDiffs,
"new-section", key,
"new-value");
+ GNUNET_free (key);
}
break;
}
@@ -209,12 +213,15 @@
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);
@@ -225,7 +232,7 @@
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");
@@ -249,6 +256,7 @@
#endif
GNUNET_CONFIGURATION_destroy (cfg);
GNUNET_CONFIGURATION_destroy (cfgDiffs);
+ GNUNET_free (diffsFileName);
return ret;
}
Modified: gnunet/src/util/test_resolver_api.c
===================================================================
--- gnunet/src/util/test_resolver_api.c 2009-11-22 18:37:41 UTC (rev 9628)
+++ gnunet/src/util/test_resolver_api.c 2009-11-22 19:06:54 UTC (rev 9629)
@@ -159,6 +159,7 @@
{
int ok = 1 + 2 + 4 + 8;
char *fn;
+ char *pfx;
pid_t pid;
char *const argv[] = { "test-resolver-api",
"-c",
@@ -171,9 +172,11 @@
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r9629 - gnunet/src/util,
gnunet <=