aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/bio.c57
-rw-r--r--src/util/buffer.c2
-rw-r--r--src/util/client.c10
-rw-r--r--src/util/common_allocation.c5
-rw-r--r--src/util/common_logging.c6
-rw-r--r--src/util/configuration.c53
-rw-r--r--src/util/container_bloomfilter.c2
-rw-r--r--src/util/container_meta_data.c14
-rw-r--r--src/util/crypto_ecc.c10
-rw-r--r--src/util/crypto_hash.c4
-rw-r--r--src/util/crypto_kdf.c4
-rw-r--r--src/util/crypto_mpi.c4
-rw-r--r--src/util/crypto_rsa.c3
-rw-r--r--src/util/disk.c48
-rw-r--r--src/util/dnsparser.c26
-rw-r--r--src/util/getopt_helpers.c4
-rw-r--r--src/util/gnunet-config.c2
-rw-r--r--src/util/gnunet-qr.c10
-rw-r--r--src/util/gnunet-scrypt.c2
-rw-r--r--src/util/gnunet-service-resolver.c12
-rw-r--r--src/util/gnunet-uri.c5
-rw-r--r--src/util/helper.c10
-rw-r--r--src/util/mq.c2
-rw-r--r--src/util/network.c2
-rw-r--r--src/util/os_installation.c8
-rw-r--r--src/util/os_priority.c54
-rw-r--r--src/util/perf_malloc.c4
-rw-r--r--src/util/perf_scheduler.c4
-rw-r--r--src/util/program.c8
-rw-r--r--src/util/regex.c14
-rw-r--r--src/util/scheduler.c5
-rw-r--r--src/util/service.c44
-rw-r--r--src/util/socks.c6
-rw-r--r--src/util/strings.c4
-rw-r--r--src/util/test_bio.c14
-rw-r--r--src/util/test_common_allocation.c7
-rw-r--r--src/util/test_common_logging_runtime_loglevels.c7
-rw-r--r--src/util/test_configuration.c2
-rw-r--r--src/util/test_container_meta_data.c2
-rw-r--r--src/util/test_container_multihashmap.c2
-rw-r--r--src/util/test_container_multipeermap.c2
-rw-r--r--src/util/test_crypto_symmetric.c2
-rw-r--r--src/util/test_os_start_process.c8
-rw-r--r--src/util/test_resolver_api.c6
-rw-r--r--src/util/test_scheduler.c2
45 files changed, 258 insertions, 244 deletions
diff --git a/src/util/bio.c b/src/util/bio.c
index ce15f073b..39050bb87 100644
--- a/src/util/bio.c
+++ b/src/util/bio.c
@@ -171,7 +171,7 @@ GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg)
171 if (NULL != emsg) 171 if (NULL != emsg)
172 *emsg = h->emsg; 172 *emsg = h->emsg;
173 else 173 else
174 GNUNET_free_non_null (h->emsg); 174 GNUNET_free (h->emsg);
175 switch (h->type) 175 switch (h->type)
176 { 176 {
177 case IO_FILE: 177 case IO_FILE:
@@ -260,7 +260,7 @@ read_from_buffer (struct GNUNET_BIO_ReadHandle *h,
260 char *result, 260 char *result,
261 size_t len) 261 size_t len)
262{ 262{
263 if (h->size < len || h->size - h->pos < len) 263 if ((h->size < len) || (h->size - h->pos < len))
264 { 264 {
265 GNUNET_asprintf (&h->emsg, 265 GNUNET_asprintf (&h->emsg,
266 _ ("Error while reading `%s' from buffer: %s"), 266 _ ("Error while reading `%s' from buffer: %s"),
@@ -345,7 +345,7 @@ GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h,
345 GNUNET_asprintf (&h->emsg, 345 GNUNET_asprintf (&h->emsg,
346 _ ("Error reading length of string `%s'"), 346 _ ("Error reading length of string `%s'"),
347 what); 347 what);
348 GNUNET_free_non_null (tmp); 348 GNUNET_free (tmp);
349 return GNUNET_SYSERR; 349 return GNUNET_SYSERR;
350 } 350 }
351 if (0 == big) 351 if (0 == big)
@@ -431,6 +431,7 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
431 return GNUNET_OK; 431 return GNUNET_OK;
432} 432}
433 433
434
434/** 435/**
435 * Read a float. 436 * Read a float.
436 * 437 *
@@ -439,9 +440,9 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h,
439 * @param f address of float to read 440 * @param f address of float to read
440 */ 441 */
441int 442int
442GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h, 443GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h,
443 const char *what, 444 const char *what,
444 float *f) 445 float *f)
445{ 446{
446 int32_t *i = (int32_t *) f; 447 int32_t *i = (int32_t *) f;
447 return GNUNET_BIO_read_int32 (h, what, i); 448 return GNUNET_BIO_read_int32 (h, what, i);
@@ -456,9 +457,9 @@ GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h,
456 * @param f address of double to read 457 * @param f address of double to read
457 */ 458 */
458int 459int
459GNUNET_BIO_read_double(struct GNUNET_BIO_ReadHandle *h, 460GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h,
460 const char *what, 461 const char *what,
461 double *f) 462 double *f)
462{ 463{
463 int64_t *i = (int64_t *) f; 464 int64_t *i = (int64_t *) f;
464 return GNUNET_BIO_read_int64 (h, what, i); 465 return GNUNET_BIO_read_int64 (h, what, i);
@@ -612,7 +613,7 @@ GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg)
612 if (NULL != emsg) 613 if (NULL != emsg)
613 *emsg = h->emsg; 614 *emsg = h->emsg;
614 else 615 else
615 GNUNET_free_non_null (h->emsg); 616 GNUNET_free (h->emsg);
616 switch (h->type) 617 switch (h->type)
617 { 618 {
618 case IO_FILE: 619 case IO_FILE:
@@ -623,7 +624,7 @@ GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg)
623 if (NULL != emsg) 624 if (NULL != emsg)
624 *emsg = h->emsg; 625 *emsg = h->emsg;
625 else 626 else
626 GNUNET_free_non_null (h->emsg); 627 GNUNET_free (h->emsg);
627 err = GNUNET_SYSERR; 628 err = GNUNET_SYSERR;
628 } 629 }
629 else 630 else
@@ -663,7 +664,7 @@ GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h)
663 { 664 {
664 GNUNET_DISK_file_close (h->fd); 665 GNUNET_DISK_file_close (h->fd);
665 h->fd = NULL; 666 h->fd = NULL;
666 GNUNET_free_non_null (h->emsg); 667 GNUNET_free (h->emsg);
667 GNUNET_asprintf (&h->emsg, _ ("Unable to flush buffer to file")); 668 GNUNET_asprintf (&h->emsg, _ ("Unable to flush buffer to file"));
668 return GNUNET_SYSERR; 669 return GNUNET_SYSERR;
669 } 670 }
@@ -692,13 +693,13 @@ GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h,
692{ 693{
693 if (IO_BUFFER != h->type) 694 if (IO_BUFFER != h->type)
694 return GNUNET_SYSERR; 695 return GNUNET_SYSERR;
695 if (NULL == contents || NULL == size) 696 if ((NULL == contents) || (NULL == size))
696 return GNUNET_SYSERR; 697 return GNUNET_SYSERR;
697 int ret = (NULL != h->emsg) ? GNUNET_SYSERR : GNUNET_OK; 698 int ret = (NULL != h->emsg) ? GNUNET_SYSERR : GNUNET_OK;
698 if (NULL != emsg) 699 if (NULL != emsg)
699 *emsg = h->emsg; 700 *emsg = h->emsg;
700 else 701 else
701 GNUNET_free_non_null (h->emsg); 702 GNUNET_free (h->emsg);
702 *contents = GNUNET_buffer_reap ((struct GNUNET_Buffer *) h->buffer, size); 703 *contents = GNUNET_buffer_reap ((struct GNUNET_Buffer *) h->buffer, size);
703 return ret; 704 return ret;
704} 705}
@@ -750,7 +751,7 @@ write_to_file (struct GNUNET_BIO_WriteHandle *h,
750 _ ("Error while writing `%s' to file: %s"), 751 _ ("Error while writing `%s' to file: %s"),
751 what, 752 what,
752 tmp); 753 tmp);
753 GNUNET_free_non_null (tmp); 754 GNUNET_free (tmp);
754 return GNUNET_SYSERR; 755 return GNUNET_SYSERR;
755 } 756 }
756 } 757 }
@@ -870,7 +871,7 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
870 if (-1 == size) 871 if (-1 == size)
871 { 872 {
872 GNUNET_free (buf); 873 GNUNET_free (buf);
873 GNUNET_free_non_null (h->emsg); 874 GNUNET_free (h->emsg);
874 GNUNET_asprintf (&h->emsg, 875 GNUNET_asprintf (&h->emsg,
875 _ ("Failed to serialize metadata `%s'"), 876 _ ("Failed to serialize metadata `%s'"),
876 what); 877 what);
@@ -897,9 +898,9 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h,
897 * @param f float to write 898 * @param f float to write
898 */ 899 */
899int 900int
900GNUNET_BIO_write_float(struct GNUNET_BIO_WriteHandle *h, 901GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h,
901 const char *what, 902 const char *what,
902 float f) 903 float f)
903{ 904{
904 int32_t i = f; 905 int32_t i = f;
905 return GNUNET_BIO_write_int32 (h, what, i); 906 return GNUNET_BIO_write_int32 (h, what, i);
@@ -914,9 +915,9 @@ GNUNET_BIO_write_float(struct GNUNET_BIO_WriteHandle *h,
914 * @param f double to write 915 * @param f double to write
915 */ 916 */
916int 917int
917GNUNET_BIO_write_double(struct GNUNET_BIO_WriteHandle *h, 918GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h,
918 const char *what, 919 const char *what,
919 double f) 920 double f)
920{ 921{
921 int64_t i = f; 922 int64_t i = f;
922 return GNUNET_BIO_write_int64 (h, what, i); 923 return GNUNET_BIO_write_int64 (h, what, i);
@@ -1196,7 +1197,7 @@ GNUNET_BIO_read_spec_int64 (const char *what,
1196 * @param f address of float to read 1197 * @param f address of float to read
1197 */ 1198 */
1198struct GNUNET_BIO_ReadSpec 1199struct GNUNET_BIO_ReadSpec
1199GNUNET_BIO_read_spec_float(const char *what, float *f) 1200GNUNET_BIO_read_spec_float (const char *what, float *f)
1200{ 1201{
1201 struct GNUNET_BIO_ReadSpec rs = { 1202 struct GNUNET_BIO_ReadSpec rs = {
1202 .rh = &read_spec_handler_int32, 1203 .rh = &read_spec_handler_int32,
@@ -1216,7 +1217,7 @@ GNUNET_BIO_read_spec_float(const char *what, float *f)
1216 * @param f address of double to read 1217 * @param f address of double to read
1217 */ 1218 */
1218struct GNUNET_BIO_ReadSpec 1219struct GNUNET_BIO_ReadSpec
1219GNUNET_BIO_read_spec_double(const char *what, double *f) 1220GNUNET_BIO_read_spec_double (const char *what, double *f)
1220{ 1221{
1221 struct GNUNET_BIO_ReadSpec rs = { 1222 struct GNUNET_BIO_ReadSpec rs = {
1222 .rh = &read_spec_handler_int64, 1223 .rh = &read_spec_handler_int64,
@@ -1243,7 +1244,7 @@ GNUNET_BIO_read_spec_commit (struct GNUNET_BIO_ReadHandle *h,
1243{ 1244{
1244 int ret = GNUNET_OK; 1245 int ret = GNUNET_OK;
1245 1246
1246 for (size_t i=0; NULL!=rs[i].rh; ++i) 1247 for (size_t i = 0; NULL!=rs[i].rh; ++i)
1247 { 1248 {
1248 ret = rs[i].rh (rs[i].cls, h, rs[i].what, rs[i].target, rs[i].size); 1249 ret = rs[i].rh (rs[i].cls, h, rs[i].what, rs[i].target, rs[i].size);
1249 if (GNUNET_OK != ret) 1250 if (GNUNET_OK != ret)
@@ -1490,7 +1491,7 @@ GNUNET_BIO_write_spec_int64 (const char *what,
1490 * @return the write spec 1491 * @return the write spec
1491 */ 1492 */
1492struct GNUNET_BIO_WriteSpec 1493struct GNUNET_BIO_WriteSpec
1493GNUNET_BIO_write_spec_float(const char *what, float *f) 1494GNUNET_BIO_write_spec_float (const char *what, float *f)
1494{ 1495{
1495 struct GNUNET_BIO_WriteSpec ws = { 1496 struct GNUNET_BIO_WriteSpec ws = {
1496 .wh = &write_spec_handler_int32, 1497 .wh = &write_spec_handler_int32,
@@ -1512,7 +1513,7 @@ GNUNET_BIO_write_spec_float(const char *what, float *f)
1512 * @return the write spec 1513 * @return the write spec
1513 */ 1514 */
1514struct GNUNET_BIO_WriteSpec 1515struct GNUNET_BIO_WriteSpec
1515GNUNET_BIO_write_spec_double(const char *what, double *f) 1516GNUNET_BIO_write_spec_double (const char *what, double *f)
1516{ 1517{
1517 struct GNUNET_BIO_WriteSpec ws = { 1518 struct GNUNET_BIO_WriteSpec ws = {
1518 .wh = &write_spec_handler_int64, 1519 .wh = &write_spec_handler_int64,
@@ -1540,7 +1541,7 @@ GNUNET_BIO_write_spec_commit (struct GNUNET_BIO_WriteHandle *h,
1540{ 1541{
1541 int ret = GNUNET_OK; 1542 int ret = GNUNET_OK;
1542 1543
1543 for (size_t i=0; NULL!=ws[i].wh; ++i) 1544 for (size_t i = 0; NULL!=ws[i].wh; ++i)
1544 { 1545 {
1545 ret = ws[i].wh (ws[i].cls, h, ws[i].what, ws[i].source, ws[i].source_size); 1546 ret = ws[i].wh (ws[i].cls, h, ws[i].what, ws[i].source, ws[i].source_size);
1546 if (GNUNET_OK != ret) 1547 if (GNUNET_OK != ret)
diff --git a/src/util/buffer.c b/src/util/buffer.c
index c865f6307..d0261889e 100644
--- a/src/util/buffer.c
+++ b/src/util/buffer.c
@@ -162,7 +162,7 @@ GNUNET_buffer_reap (struct GNUNET_Buffer *buf, size_t *size)
162void 162void
163GNUNET_buffer_clear (struct GNUNET_Buffer *buf) 163GNUNET_buffer_clear (struct GNUNET_Buffer *buf)
164{ 164{
165 GNUNET_free_non_null (buf->mem); 165 GNUNET_free (buf->mem);
166 memset (buf, 0, sizeof (struct GNUNET_Buffer)); 166 memset (buf, 0, sizeof (struct GNUNET_Buffer));
167} 167}
168 168
diff --git a/src/util/client.c b/src/util/client.c
index a7b1a2a0f..86dabe664 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -422,7 +422,7 @@ connection_client_destroy_impl (struct GNUNET_MQ_Handle *mq,
422 } 422 }
423 cancel_aps (cstate); 423 cancel_aps (cstate);
424 GNUNET_free (cstate->service_name); 424 GNUNET_free (cstate->service_name);
425 GNUNET_free_non_null (cstate->hostname); 425 GNUNET_free (cstate->hostname);
426 GNUNET_MST_destroy (cstate->mst); 426 GNUNET_MST_destroy (cstate->mst);
427 GNUNET_free (cstate); 427 GNUNET_free (cstate);
428} 428}
@@ -563,7 +563,7 @@ try_unixpath (const char *service_name,
563 if (NULL != sock) 563 if (NULL != sock)
564 GNUNET_NETWORK_socket_close (sock); 564 GNUNET_NETWORK_socket_close (sock);
565 } 565 }
566 GNUNET_free_non_null (unixpath); 566 GNUNET_free (unixpath);
567#endif 567#endif
568 return NULL; 568 return NULL;
569} 569}
@@ -747,7 +747,7 @@ test_service_configuration (const char *service_name,
747 _ ("not a valid filename")); 747 _ ("not a valid filename"));
748 return GNUNET_SYSERR; /* UNIXPATH specified but invalid! */ 748 return GNUNET_SYSERR; /* UNIXPATH specified but invalid! */
749 } 749 }
750 GNUNET_free_non_null (unixpath); 750 GNUNET_free (unixpath);
751#endif 751#endif
752 752
753 if ((GNUNET_YES == 753 if ((GNUNET_YES ==
@@ -768,7 +768,7 @@ test_service_configuration (const char *service_name,
768 &hostname)) && 768 &hostname)) &&
769 (0 != strlen (hostname))) 769 (0 != strlen (hostname)))
770 ret = GNUNET_OK; 770 ret = GNUNET_OK;
771 GNUNET_free_non_null (hostname); 771 GNUNET_free (hostname);
772 return ret; 772 return ret;
773} 773}
774 774
@@ -1043,7 +1043,7 @@ GNUNET_CLIENT_test (const struct GNUNET_CONFIGURATION_Handle *cfg,
1043 /* service running remotely */ 1043 /* service running remotely */
1044 ret = GNUNET_OK; 1044 ret = GNUNET_OK;
1045 } 1045 }
1046 GNUNET_free_non_null (hostname); 1046 GNUNET_free (hostname);
1047 return ret; 1047 return ret;
1048} 1048}
1049 1049
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c
index fd91e23b2..4aad49777 100644
--- a/src/util/common_allocation.c
+++ b/src/util/common_allocation.c
@@ -323,13 +323,12 @@ GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber)
323 * want to keep track of allocations. 323 * want to keep track of allocations.
324 * 324 *
325 * @param ptr the pointer to free 325 * @param ptr the pointer to free
326 * @param filename where in the code was the call to GNUNET_free 326 * @param filename where in the code was the call to GNUNET_free()
327 * @param linenumber where in the code was the call to GNUNET_free 327 * @param linenumber where in the code was the call to GNUNET_free()
328 */ 328 */
329void 329void
330GNUNET_xfree_ (void *ptr, const char *filename, int linenumber) 330GNUNET_xfree_ (void *ptr, const char *filename, int linenumber)
331{ 331{
332 GNUNET_assert_at (NULL != ptr, filename, linenumber);
333#ifdef W32_MEM_LIMIT 332#ifdef W32_MEM_LIMIT
334 ptr = &((size_t *) ptr)[-1]; 333 ptr = &((size_t *) ptr)[-1];
335 mem_used -= *((size_t *) ptr); 334 mem_used -= *((size_t *) ptr);
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 3894cdda1..b30175543 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -715,9 +715,9 @@ GNUNET_log_setup (const char *comp,
715#if ! defined(GNUNET_CULL_LOGGING) 715#if ! defined(GNUNET_CULL_LOGGING)
716 parse_all_definitions (); 716 parse_all_definitions ();
717#endif 717#endif
718 GNUNET_free_non_null (component); 718 GNUNET_free (component);
719 GNUNET_asprintf (&component, "%s-%d", comp, getpid ()); 719 GNUNET_asprintf (&component, "%s-%d", comp, getpid ());
720 GNUNET_free_non_null (component_nopid); 720 GNUNET_free (component_nopid);
721 component_nopid = GNUNET_strdup (comp); 721 component_nopid = GNUNET_strdup (comp);
722 722
723 env_logfile = getenv ("GNUNET_FORCE_LOGFILE"); 723 env_logfile = getenv ("GNUNET_FORCE_LOGFILE");
@@ -725,7 +725,7 @@ GNUNET_log_setup (const char *comp,
725 logfile = env_logfile; 725 logfile = env_logfile;
726 if (NULL == logfile) 726 if (NULL == logfile)
727 return GNUNET_OK; 727 return GNUNET_OK;
728 GNUNET_free_non_null (log_file_name); 728 GNUNET_free (log_file_name);
729 log_file_name = GNUNET_STRINGS_filename_expand (logfile); 729 log_file_name = GNUNET_STRINGS_filename_expand (logfile);
730 if (NULL == log_file_name) 730 if (NULL == log_file_name)
731 return GNUNET_SYSERR; 731 return GNUNET_SYSERR;
diff --git a/src/util/configuration.c b/src/util/configuration.c
index 7ed87cc1e..26beacaff 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -286,7 +286,7 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
286 line_orig = NULL; 286 line_orig = NULL;
287 while (r_bytes < size) 287 while (r_bytes < size)
288 { 288 {
289 GNUNET_free_non_null (line_orig); 289 GNUNET_free (line_orig);
290 /* fgets-like behaviour on buffer */ 290 /* fgets-like behaviour on buffer */
291 to_read = size - r_bytes; 291 to_read = size - r_bytes;
292 pos = memchr (&mem[r_bytes], '\n', to_read); 292 pos = memchr (&mem[r_bytes], '\n', to_read);
@@ -404,7 +404,7 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg,
404 ret = GNUNET_SYSERR; 404 ret = GNUNET_SYSERR;
405 break; 405 break;
406 } 406 }
407 GNUNET_free_non_null (line_orig); 407 GNUNET_free (line_orig);
408 GNUNET_free (section); 408 GNUNET_free (section);
409 GNUNET_assert ((GNUNET_OK != ret) || (r_bytes == size)); 409 GNUNET_assert ((GNUNET_OK != ret) || (r_bytes == size));
410 return ret; 410 return ret;
@@ -734,7 +734,7 @@ GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg,
734 { 734 {
735 spos->entries = ent->next; 735 spos->entries = ent->next;
736 GNUNET_free (ent->key); 736 GNUNET_free (ent->key);
737 GNUNET_free_non_null (ent->val); 737 GNUNET_free (ent->val);
738 GNUNET_free (ent); 738 GNUNET_free (ent);
739 cfg->dirty = GNUNET_YES; 739 cfg->dirty = GNUNET_YES;
740 } 740 }
@@ -926,13 +926,13 @@ GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg,
926 { 926 {
927 if (NULL == value) 927 if (NULL == value)
928 { 928 {
929 GNUNET_free_non_null (e->val); 929 GNUNET_free (e->val);
930 e->val = NULL; 930 e->val = NULL;
931 } 931 }
932 else 932 else
933 { 933 {
934 nv = GNUNET_strdup (value); 934 nv = GNUNET_strdup (value);
935 GNUNET_free_non_null (e->val); 935 GNUNET_free (e->val);
936 e->val = nv; 936 e->val = nv;
937 } 937 }
938 return; 938 return;
@@ -1383,7 +1383,7 @@ expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg,
1383 result = GNUNET_malloc (strlen (prefix) + strlen (post) + 1); 1383 result = GNUNET_malloc (strlen (prefix) + strlen (post) + 1);
1384 strcpy (result, prefix); 1384 strcpy (result, prefix);
1385 strcat (result, post); 1385 strcat (result, post);
1386 GNUNET_free_non_null (def); 1386 GNUNET_free (def);
1387 GNUNET_free (prefix); 1387 GNUNET_free (prefix);
1388 GNUNET_free (orig); 1388 GNUNET_free (orig);
1389 return result; 1389 return result;
@@ -1810,4 +1810,45 @@ GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg,
1810} 1810}
1811 1811
1812 1812
1813/**
1814 * Return GNUnet's default configuration. A new configuration is allocated
1815 * each time and it's up to the caller to destroy it when done. This function
1816 * returns GNUnet's configuration even when #GNUNET_OS_init has been called
1817 * with a value different from #GNUNET_OS_project_data_default.
1818 *
1819 * @return a freshly allocated configuration
1820 */
1821struct GNUNET_CONFIGURATION_Handle *
1822GNUNET_CONFIGURATION_default (void)
1823{
1824 const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get ();
1825 const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default ();
1826
1827 GNUNET_OS_init (dpd);
1828
1829 struct GNUNET_CONFIGURATION_Handle *cfg = GNUNET_CONFIGURATION_create ();
1830 const char *xdg = getenv ("XDG_CONFIG_HOME");
1831 char *cfgname = NULL;
1832
1833 if (NULL != xdg)
1834 GNUNET_asprintf (&cfgname, "%s/%s", xdg, pd->config_file);
1835 else
1836 cfgname = GNUNET_strdup (pd->user_config_file);
1837
1838 if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfgname))
1839 {
1840 GNUNET_OS_init (pd);
1841 GNUNET_CONFIGURATION_destroy (cfg);
1842 GNUNET_free (cfgname);
1843 return NULL;
1844 }
1845
1846 GNUNET_free (cfgname);
1847
1848 GNUNET_OS_init (pd);
1849
1850 return cfg;
1851}
1852
1853
1813/* end of configuration.c */ 1854/* end of configuration.c */
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c
index eca651862..d7460043d 100644
--- a/src/util/container_bloomfilter.c
+++ b/src/util/container_bloomfilter.c
@@ -707,7 +707,7 @@ GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter *bf)
707 return; 707 return;
708 if (bf->fh != NULL) 708 if (bf->fh != NULL)
709 GNUNET_DISK_file_close (bf->fh); 709 GNUNET_DISK_file_close (bf->fh);
710 GNUNET_free_non_null (bf->filename); 710 GNUNET_free (bf->filename);
711 GNUNET_free (bf->bitArray); 711 GNUNET_free (bf->bitArray);
712 GNUNET_free (bf); 712 GNUNET_free (bf);
713} 713}
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c
index ad362408e..b66a7b258 100644
--- a/src/util/container_meta_data.c
+++ b/src/util/container_meta_data.c
@@ -217,9 +217,9 @@ GNUNET_CONTAINER_meta_data_create ()
217static void 217static void
218meta_item_free (struct MetaItem *mi) 218meta_item_free (struct MetaItem *mi)
219{ 219{
220 GNUNET_free_non_null (mi->plugin_name); 220 GNUNET_free (mi->plugin_name);
221 GNUNET_free_non_null (mi->mime_type); 221 GNUNET_free (mi->mime_type);
222 GNUNET_free_non_null (mi->data); 222 GNUNET_free (mi->data);
223 GNUNET_free (mi); 223 GNUNET_free (mi);
224} 224}
225 225
@@ -258,7 +258,7 @@ GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md)
258 GNUNET_CONTAINER_DLL_remove (md->items_head, md->items_tail, pos); 258 GNUNET_CONTAINER_DLL_remove (md->items_head, md->items_tail, pos);
259 meta_item_free (pos); 259 meta_item_free (pos);
260 } 260 }
261 GNUNET_free_non_null (md->sbuf); 261 GNUNET_free (md->sbuf);
262 GNUNET_free (md); 262 GNUNET_free (md);
263} 263}
264 264
@@ -280,7 +280,7 @@ GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md)
280 GNUNET_CONTAINER_DLL_remove (md->items_head, md->items_tail, mi); 280 GNUNET_CONTAINER_DLL_remove (md->items_head, md->items_tail, mi);
281 meta_item_free (mi); 281 meta_item_free (mi);
282 } 282 }
283 GNUNET_free_non_null (md->sbuf); 283 GNUNET_free (md->sbuf);
284 memset (md, 0, sizeof(struct GNUNET_CONTAINER_MetaData)); 284 memset (md, 0, sizeof(struct GNUNET_CONTAINER_MetaData));
285} 285}
286 286
@@ -976,7 +976,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
976 if (NULL != pos->mime_type) 976 if (NULL != pos->mime_type)
977 left -= strlen (pos->mime_type) + 1; 977 left -= strlen (pos->mime_type) + 1;
978 978
979 GNUNET_free_non_null (cdata); 979 GNUNET_free (cdata);
980 cdata = NULL; 980 cdata = NULL;
981 981
982 i++; 982 i++;
@@ -1180,7 +1180,7 @@ GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size)
1180 ntohl (ent.type), format, mime_type, 1180 ntohl (ent.type), format, mime_type,
1181 meta_data, dlen); 1181 meta_data, dlen);
1182 } 1182 }
1183 GNUNET_free_non_null (data); 1183 GNUNET_free (data);
1184 return md; 1184 return md;
1185} 1185}
1186 1186
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c
index e1608ae55..019dbe94e 100644
--- a/src/util/crypto_ecc.c
+++ b/src/util/crypto_ecc.c
@@ -141,7 +141,7 @@ decode_private_ecdsa_key (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv)
141 int rc; 141 int rc;
142 uint8_t d[32]; 142 uint8_t d[32];
143 143
144 for (size_t i=0; i<32; i++) 144 for (size_t i = 0; i<32; i++)
145 d[i] = priv->d[31 - i]; 145 d[i] = priv->d[31 - i];
146 146
147 rc = gcry_sexp_build (&result, 147 rc = gcry_sexp_build (&result,
@@ -195,7 +195,7 @@ GNUNET_CRYPTO_eddsa_key_get_public (
195 struct GNUNET_CRYPTO_EddsaPublicKey *pub) 195 struct GNUNET_CRYPTO_EddsaPublicKey *pub)
196{ 196{
197 unsigned char pk[crypto_sign_PUBLICKEYBYTES]; 197 unsigned char pk[crypto_sign_PUBLICKEYBYTES];
198 unsigned char sk[crypto_sign_SECRETKEYBYTES]; 198 unsigned char sk[crypto_sign_SECRETKEYBYTES];
199 199
200 BENCHMARK_START (eddsa_key_get_public); 200 BENCHMARK_START (eddsa_key_get_public);
201 GNUNET_assert (0 == crypto_sign_seed_keypair (pk, sk, priv->d)); 201 GNUNET_assert (0 == crypto_sign_seed_keypair (pk, sk, priv->d));
@@ -929,7 +929,7 @@ GNUNET_CRYPTO_ecdsa_private_key_derive (
929 929
930 h = derive_h (&pub, label, context); 930 h = derive_h (&pub, label, context);
931 /* Convert to big endian for libgcrypt */ 931 /* Convert to big endian for libgcrypt */
932 for (size_t i=0; i < 32; i++) 932 for (size_t i = 0; i < 32; i++)
933 dc[i] = priv->d[31 - i]; 933 dc[i] = priv->d[31 - i];
934 GNUNET_CRYPTO_mpi_scan_unsigned (&x, dc, sizeof(dc)); 934 GNUNET_CRYPTO_mpi_scan_unsigned (&x, dc, sizeof(dc));
935 d = gcry_mpi_new (256); 935 d = gcry_mpi_new (256);
@@ -941,9 +941,9 @@ GNUNET_CRYPTO_ecdsa_private_key_derive (
941 ret = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey); 941 ret = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
942 GNUNET_CRYPTO_mpi_print_unsigned (dc, sizeof(dc), d); 942 GNUNET_CRYPTO_mpi_print_unsigned (dc, sizeof(dc), d);
943 /* Convert to big endian for libgcrypt */ 943 /* Convert to big endian for libgcrypt */
944 for (size_t i=0; i < 32; i++) 944 for (size_t i = 0; i < 32; i++)
945 ret->d[i] = dc[31 - i]; 945 ret->d[i] = dc[31 - i];
946 sodium_memzero(dc, sizeof(dc)); 946 sodium_memzero (dc, sizeof(dc));
947 gcry_mpi_release (d); 947 gcry_mpi_release (d);
948 return ret; 948 return ret;
949} 949}
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index 622953476..0dbe9dbe8 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -250,12 +250,13 @@ GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode *hc,
250 */ 250 */
251int 251int
252GNUNET_CRYPTO_hash_get_bit_ltr (const struct GNUNET_HashCode *code, 252GNUNET_CRYPTO_hash_get_bit_ltr (const struct GNUNET_HashCode *code,
253 unsigned int bit) 253 unsigned int bit)
254{ 254{
255 GNUNET_assert (bit < 8 * sizeof(struct GNUNET_HashCode)); 255 GNUNET_assert (bit < 8 * sizeof(struct GNUNET_HashCode));
256 return (((unsigned char *) code)[bit >> 3] & (128 >> (bit & 7))) > 0; 256 return (((unsigned char *) code)[bit >> 3] & (128 >> (bit & 7))) > 0;
257} 257}
258 258
259
259/** 260/**
260 * Obtain a bit from a hashcode. 261 * Obtain a bit from a hashcode.
261 * @param code the GNUNET_CRYPTO_hash to index bit-wise 262 * @param code the GNUNET_CRYPTO_hash to index bit-wise
@@ -272,7 +273,6 @@ GNUNET_CRYPTO_hash_get_bit_rtl (const struct GNUNET_HashCode *code,
272} 273}
273 274
274 275
275
276/** 276/**
277 * Determine how many low order bits match in two 277 * Determine how many low order bits match in two
278 * `struct GNUNET_HashCode`s. i.e. - 010011 and 011111 share 278 * `struct GNUNET_HashCode`s. i.e. - 010011 and 011111 share
diff --git a/src/util/crypto_kdf.c b/src/util/crypto_kdf.c
index 1b3bd686f..4f3830308 100644
--- a/src/util/crypto_kdf.c
+++ b/src/util/crypto_kdf.c
@@ -62,7 +62,8 @@ GNUNET_CRYPTO_kdf_v (void *result,
62 * hash function." 62 * hash function."
63 * 63 *
64 * http://eprint.iacr.org/2010/264 64 * http://eprint.iacr.org/2010/264
65 */return GNUNET_CRYPTO_hkdf_v (result, 65 *///
66 return GNUNET_CRYPTO_hkdf_v (result,
66 out_len, 67 out_len,
67 GCRY_MD_SHA512, 68 GCRY_MD_SHA512,
68 GCRY_MD_SHA256, 69 GCRY_MD_SHA256,
@@ -142,7 +143,6 @@ GNUNET_CRYPTO_kdf_mod_mpi (gcry_mpi_t *r,
142 { 143 {
143 /* Ain't clear if n is always divisible by 8 */ 144 /* Ain't clear if n is always divisible by 8 */
144 uint8_t buf[ (nbits - 1) / 8 + 1 ]; 145 uint8_t buf[ (nbits - 1) / 8 + 1 ];
145
146 uint16_t ctr_nbo = htons (ctr); 146 uint16_t ctr_nbo = htons (ctr);
147 147
148 rc = GNUNET_CRYPTO_kdf (buf, 148 rc = GNUNET_CRYPTO_kdf (buf,
diff --git a/src/util/crypto_mpi.c b/src/util/crypto_mpi.c
index 099921611..6df47c7e1 100644
--- a/src/util/crypto_mpi.c
+++ b/src/util/crypto_mpi.c
@@ -157,8 +157,8 @@ GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result,
157 */ 157 */
158void 158void
159GNUNET_CRYPTO_mpi_scan_unsigned_le (gcry_mpi_t *result, 159GNUNET_CRYPTO_mpi_scan_unsigned_le (gcry_mpi_t *result,
160 const void *data, 160 const void *data,
161 size_t size) 161 size_t size)
162{ 162{
163 int rc; 163 int rc;
164 164
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c
index cb4640d48..b12ec7434 100644
--- a/src/util/crypto_rsa.c
+++ b/src/util/crypto_rsa.c
@@ -1301,7 +1301,8 @@ GNUNET_CRYPTO_rsa_verify (const struct GNUNET_HashCode *hash,
1301 * so the exchange is being malicious in an unfamilair way, maybe 1301 * so the exchange is being malicious in an unfamilair way, maybe
1302 * just trying to crash us. Arguably, we've only an internal error 1302 * just trying to crash us. Arguably, we've only an internal error
1303 * though because we should've detected this in our previous call 1303 * though because we should've detected this in our previous call
1304 * to GNUNET_CRYPTO_rsa_unblind. */return GNUNET_NO; 1304 * to GNUNET_CRYPTO_rsa_unblind. *///
1305 return GNUNET_NO;
1305 } 1306 }
1306 1307
1307 data = mpi_to_sexp (r); 1308 data = mpi_to_sexp (r);
diff --git a/src/util/disk.c b/src/util/disk.c
index 9018aa955..6560726ea 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1451,33 +1451,23 @@ GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h)
1451/** 1451/**
1452 * Creates an interprocess channel 1452 * Creates an interprocess channel
1453 * 1453 *
1454 * @param blocking_read creates an asynchronous pipe for reading if set to GNUNET_NO 1454 * @param pf how to configure the pipe
1455 * @param blocking_write creates an asynchronous pipe for writing if set to GNUNET_NO
1456 * @param inherit_read inherit the parent processes stdin (only for windows)
1457 * @param inherit_write inherit the parent processes stdout (only for windows)
1458 * @return handle to the new pipe, NULL on error 1455 * @return handle to the new pipe, NULL on error
1459 */ 1456 */
1460struct GNUNET_DISK_PipeHandle * 1457struct GNUNET_DISK_PipeHandle *
1461GNUNET_DISK_pipe (int blocking_read, 1458GNUNET_DISK_pipe (enum GNUNET_DISK_PipeFlags pf)
1462 int blocking_write,
1463 int inherit_read,
1464 int inherit_write)
1465{ 1459{
1466 int fd[2]; 1460 int fd[2];
1467 int ret;
1468 int eno;
1469 1461
1470 (void) inherit_read; 1462 if (-1 == pipe (fd))
1471 (void) inherit_write;
1472 ret = pipe (fd);
1473 if (ret == -1)
1474 { 1463 {
1475 eno = errno; 1464 int eno = errno;
1465
1476 LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "pipe"); 1466 LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "pipe");
1477 errno = eno; 1467 errno = eno;
1478 return NULL; 1468 return NULL;
1479 } 1469 }
1480 return GNUNET_DISK_pipe_from_fd (blocking_read, blocking_write, fd); 1470 return GNUNET_DISK_pipe_from_fd (pf, fd);
1481} 1471}
1482 1472
1483 1473
@@ -1485,29 +1475,26 @@ GNUNET_DISK_pipe (int blocking_read,
1485 * Creates a pipe object from a couple of file descriptors. 1475 * Creates a pipe object from a couple of file descriptors.
1486 * Useful for wrapping existing pipe FDs. 1476 * Useful for wrapping existing pipe FDs.
1487 * 1477 *
1488 * @param blocking_read creates an asynchronous pipe for reading if set to GNUNET_NO 1478 * @param pf how to configure the pipe
1489 * @param blocking_write creates an asynchronous pipe for writing if set to GNUNET_NO
1490 * @param fd an array of two fd values. One of them may be -1 for read-only or write-only pipes 1479 * @param fd an array of two fd values. One of them may be -1 for read-only or write-only pipes
1491 * 1480 *
1492 * @return handle to the new pipe, NULL on error 1481 * @return handle to the new pipe, NULL on error
1493 */ 1482 */
1494struct GNUNET_DISK_PipeHandle * 1483struct GNUNET_DISK_PipeHandle *
1495GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) 1484GNUNET_DISK_pipe_from_fd (enum GNUNET_DISK_PipeFlags pf,
1485 int fd[2])
1496{ 1486{
1497 struct GNUNET_DISK_PipeHandle *p; 1487 struct GNUNET_DISK_PipeHandle *p;
1498 1488 int ret = 0;
1499 p = GNUNET_new (struct GNUNET_DISK_PipeHandle);
1500
1501 int ret;
1502 int flags; 1489 int flags;
1503 int eno = 0; /* make gcc happy */ 1490 int eno = 0; /* make gcc happy */
1504 1491
1505 ret = 0; 1492 p = GNUNET_new (struct GNUNET_DISK_PipeHandle);
1506 if (fd[0] >= 0) 1493 if (fd[0] >= 0)
1507 { 1494 {
1508 p->fd[0] = GNUNET_new (struct GNUNET_DISK_FileHandle); 1495 p->fd[0] = GNUNET_new (struct GNUNET_DISK_FileHandle);
1509 p->fd[0]->fd = fd[0]; 1496 p->fd[0]->fd = fd[0];
1510 if (! blocking_read) 1497 if (0 == (GNUNET_DISK_PF_BLOCKING_READ & pf))
1511 { 1498 {
1512 flags = fcntl (fd[0], F_GETFL); 1499 flags = fcntl (fd[0], F_GETFL);
1513 flags |= O_NONBLOCK; 1500 flags |= O_NONBLOCK;
@@ -1530,7 +1517,7 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2])
1530 { 1517 {
1531 p->fd[1] = GNUNET_new (struct GNUNET_DISK_FileHandle); 1518 p->fd[1] = GNUNET_new (struct GNUNET_DISK_FileHandle);
1532 p->fd[1]->fd = fd[1]; 1519 p->fd[1]->fd = fd[1];
1533 if (! blocking_write) 1520 if (0 == (GNUNET_DISK_PF_BLOCKING_WRITE & pf))
1534 { 1521 {
1535 flags = fcntl (fd[1], F_GETFL); 1522 flags = fcntl (fd[1], F_GETFL);
1536 flags |= O_NONBLOCK; 1523 flags |= O_NONBLOCK;
@@ -1556,13 +1543,12 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2])
1556 GNUNET_break (0 == close (p->fd[0]->fd)); 1543 GNUNET_break (0 == close (p->fd[0]->fd));
1557 if (p->fd[1]->fd >= 0) 1544 if (p->fd[1]->fd >= 0)
1558 GNUNET_break (0 == close (p->fd[1]->fd)); 1545 GNUNET_break (0 == close (p->fd[1]->fd));
1559 GNUNET_free_non_null (p->fd[0]); 1546 GNUNET_free (p->fd[0]);
1560 GNUNET_free_non_null (p->fd[1]); 1547 GNUNET_free (p->fd[1]);
1561 GNUNET_free (p); 1548 GNUNET_free (p);
1562 errno = eno; 1549 errno = eno;
1563 return NULL; 1550 return NULL;
1564 } 1551 }
1565
1566 return p; 1552 return p;
1567} 1553}
1568 1554
@@ -1572,7 +1558,7 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2])
1572 * 1558 *
1573 * @param p pipe to close 1559 * @param p pipe to close
1574 * @param end which end of the pipe to close 1560 * @param end which end of the pipe to close
1575 * @return GNUNET_OK on success, GNUNET_SYSERR otherwise 1561 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
1576 */ 1562 */
1577int 1563int
1578GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, 1564GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p,
@@ -1644,7 +1630,7 @@ GNUNET_DISK_pipe_detach_end (struct GNUNET_DISK_PipeHandle *p,
1644 * Closes an interprocess channel 1630 * Closes an interprocess channel
1645 * 1631 *
1646 * @param p pipe to close 1632 * @param p pipe to close
1647 * @return GNUNET_OK on success, GNUNET_SYSERR otherwise 1633 * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise
1648 */ 1634 */
1649int 1635int
1650GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p) 1636GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p)
diff --git a/src/util/dnsparser.c b/src/util/dnsparser.c
index ab687414e..401723106 100644
--- a/src/util/dnsparser.c
+++ b/src/util/dnsparser.c
@@ -109,8 +109,8 @@ GNUNET_DNSPARSER_free_soa (struct GNUNET_DNSPARSER_SoaRecord *soa)
109{ 109{
110 if (NULL == soa) 110 if (NULL == soa)
111 return; 111 return;
112 GNUNET_free_non_null (soa->mname); 112 GNUNET_free (soa->mname);
113 GNUNET_free_non_null (soa->rname); 113 GNUNET_free (soa->rname);
114 GNUNET_free (soa); 114 GNUNET_free (soa);
115} 115}
116 116
@@ -125,7 +125,7 @@ GNUNET_DNSPARSER_free_cert (struct GNUNET_DNSPARSER_CertRecord *cert)
125{ 125{
126 if (NULL == cert) 126 if (NULL == cert)
127 return; 127 return;
128 GNUNET_free_non_null (cert->certificate_data); 128 GNUNET_free (cert->certificate_data);
129 GNUNET_free (cert); 129 GNUNET_free (cert);
130} 130}
131 131
@@ -140,7 +140,7 @@ GNUNET_DNSPARSER_free_srv (struct GNUNET_DNSPARSER_SrvRecord *srv)
140{ 140{
141 if (NULL == srv) 141 if (NULL == srv)
142 return; 142 return;
143 GNUNET_free_non_null (srv->target); 143 GNUNET_free (srv->target);
144 GNUNET_free (srv); 144 GNUNET_free (srv);
145} 145}
146 146
@@ -155,7 +155,7 @@ GNUNET_DNSPARSER_free_mx (struct GNUNET_DNSPARSER_MxRecord *mx)
155{ 155{
156 if (NULL == mx) 156 if (NULL == mx)
157 return; 157 return;
158 GNUNET_free_non_null (mx->mxhost); 158 GNUNET_free (mx->mxhost);
159 GNUNET_free (mx); 159 GNUNET_free (mx);
160} 160}
161 161
@@ -168,7 +168,7 @@ GNUNET_DNSPARSER_free_mx (struct GNUNET_DNSPARSER_MxRecord *mx)
168void 168void
169GNUNET_DNSPARSER_free_record (struct GNUNET_DNSPARSER_Record *r) 169GNUNET_DNSPARSER_free_record (struct GNUNET_DNSPARSER_Record *r)
170{ 170{
171 GNUNET_free_non_null (r->name); 171 GNUNET_free (r->name);
172 switch (r->type) 172 switch (r->type)
173 { 173 {
174 case GNUNET_DNSPARSER_TYPE_MX: 174 case GNUNET_DNSPARSER_TYPE_MX:
@@ -190,11 +190,11 @@ GNUNET_DNSPARSER_free_record (struct GNUNET_DNSPARSER_Record *r)
190 case GNUNET_DNSPARSER_TYPE_NS: 190 case GNUNET_DNSPARSER_TYPE_NS:
191 case GNUNET_DNSPARSER_TYPE_CNAME: 191 case GNUNET_DNSPARSER_TYPE_CNAME:
192 case GNUNET_DNSPARSER_TYPE_PTR: 192 case GNUNET_DNSPARSER_TYPE_PTR:
193 GNUNET_free_non_null (r->data.hostname); 193 GNUNET_free (r->data.hostname);
194 break; 194 break;
195 195
196 default: 196 default:
197 GNUNET_free_non_null (r->data.raw.data); 197 GNUNET_free (r->data.raw.data);
198 break; 198 break;
199 } 199 }
200} 200}
@@ -854,17 +854,17 @@ void
854GNUNET_DNSPARSER_free_packet (struct GNUNET_DNSPARSER_Packet *p) 854GNUNET_DNSPARSER_free_packet (struct GNUNET_DNSPARSER_Packet *p)
855{ 855{
856 for (unsigned int i = 0; i < p->num_queries; i++) 856 for (unsigned int i = 0; i < p->num_queries; i++)
857 GNUNET_free_non_null (p->queries[i].name); 857 GNUNET_free (p->queries[i].name);
858 GNUNET_free_non_null (p->queries); 858 GNUNET_free (p->queries);
859 for (unsigned int i = 0; i < p->num_answers; i++) 859 for (unsigned int i = 0; i < p->num_answers; i++)
860 GNUNET_DNSPARSER_free_record (&p->answers[i]); 860 GNUNET_DNSPARSER_free_record (&p->answers[i]);
861 GNUNET_free_non_null (p->answers); 861 GNUNET_free (p->answers);
862 for (unsigned int i = 0; i < p->num_authority_records; i++) 862 for (unsigned int i = 0; i < p->num_authority_records; i++)
863 GNUNET_DNSPARSER_free_record (&p->authority_records[i]); 863 GNUNET_DNSPARSER_free_record (&p->authority_records[i]);
864 GNUNET_free_non_null (p->authority_records); 864 GNUNET_free (p->authority_records);
865 for (unsigned int i = 0; i < p->num_additional_records; i++) 865 for (unsigned int i = 0; i < p->num_additional_records; i++)
866 GNUNET_DNSPARSER_free_record (&p->additional_records[i]); 866 GNUNET_DNSPARSER_free_record (&p->additional_records[i]);
867 GNUNET_free_non_null (p->additional_records); 867 GNUNET_free (p->additional_records);
868 GNUNET_free (p); 868 GNUNET_free (p);
869} 869}
870 870
diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c
index a56ef2d96..592875531 100644
--- a/src/util/getopt_helpers.c
+++ b/src/util/getopt_helpers.c
@@ -377,7 +377,7 @@ set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
377 (void) ctx; 377 (void) ctx;
378 (void) option; 378 (void) option;
379 GNUNET_assert (NULL != value); 379 GNUNET_assert (NULL != value);
380 GNUNET_free_non_null (*val); 380 GNUNET_free (*val);
381 *val = GNUNET_strdup (value); 381 *val = GNUNET_strdup (value);
382 return GNUNET_OK; 382 return GNUNET_OK;
383} 383}
@@ -458,7 +458,7 @@ set_filename (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
458 (void) ctx; 458 (void) ctx;
459 (void) option; 459 (void) option;
460 GNUNET_assert (NULL != value); 460 GNUNET_assert (NULL != value);
461 GNUNET_free_non_null (*val); 461 GNUNET_free (*val);
462 *val = GNUNET_STRINGS_filename_expand (value); 462 *val = GNUNET_STRINGS_filename_expand (value);
463 return GNUNET_OK; 463 return GNUNET_OK;
464} 464}
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c
index 5883c1497..2b279dda2 100644
--- a/src/util/gnunet-config.c
+++ b/src/util/gnunet-config.c
@@ -258,7 +258,7 @@ run (void *cls,
258 GNUNET_CONFIGURATION_write ((NULL == out) ? diff : out, cfgfile)) 258 GNUNET_CONFIGURATION_write ((NULL == out) ? diff : out, cfgfile))
259 global_ret = 2; 259 global_ret = 2;
260 } 260 }
261 GNUNET_free_non_null (cfg_fn); 261 GNUNET_free (cfg_fn);
262 if (NULL != out) 262 if (NULL != out)
263 GNUNET_CONFIGURATION_destroy (out); 263 GNUNET_CONFIGURATION_destroy (out);
264cleanup: 264cleanup:
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c
index cd23c3a9c..83b2af2fc 100644
--- a/src/util/gnunet-qr.c
+++ b/src/util/gnunet-qr.c
@@ -31,7 +31,7 @@
31 31
32#define LOG(fmt, ...) \ 32#define LOG(fmt, ...) \
33 if (verbose) \ 33 if (verbose) \
34 printf (fmt, ## __VA_ARGS__) 34 printf (fmt, ## __VA_ARGS__)
35 35
36/** 36/**
37 * Video device to capture from. Sane default for GNU/Linux systems. 37 * Video device to capture from. Sane default for GNU/Linux systems.
@@ -161,10 +161,7 @@ gnunet_uri (void *cls,
161 return; 161 return;
162 } 162 }
163 GNUNET_free (subsystem); 163 GNUNET_free (subsystem);
164 sigpipe = GNUNET_DISK_pipe (GNUNET_NO, 164 sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
165 GNUNET_NO,
166 GNUNET_NO,
167 GNUNET_NO);
168 GNUNET_assert (NULL != sigpipe); 165 GNUNET_assert (NULL != sigpipe);
169 rt = GNUNET_SCHEDULER_add_read_file ( 166 rt = GNUNET_SCHEDULER_add_read_file (
170 GNUNET_TIME_UNIT_FOREVER_REL, 167 GNUNET_TIME_UNIT_FOREVER_REL,
@@ -192,8 +189,7 @@ gnunet_uri (void *cls,
192 GNUNET_array_append (argv, 189 GNUNET_array_append (argv,
193 argc, 190 argc,
194 NULL); 191 NULL);
195 p = GNUNET_OS_start_process_vap (GNUNET_NO, 192 p = GNUNET_OS_start_process_vap (GNUNET_OS_INHERIT_STD_ALL,
196 GNUNET_OS_INHERIT_STD_ALL,
197 NULL, 193 NULL,
198 NULL, 194 NULL,
199 NULL, 195 NULL,
diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c
index 7d13ce469..aa64144a8 100644
--- a/src/util/gnunet-scrypt.c
+++ b/src/util/gnunet-scrypt.c
@@ -323,7 +323,7 @@ main (int argc, char *const *argv)
323 ? 0 323 ? 0
324 : 1; 324 : 1;
325 GNUNET_free_nz ((void *) argv); 325 GNUNET_free_nz ((void *) argv);
326 GNUNET_free_non_null (pwfn); 326 GNUNET_free (pwfn);
327 return ret; 327 return ret;
328} 328}
329 329
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c
index 357453da7..5ed70807e 100644
--- a/src/util/gnunet-service-resolver.c
+++ b/src/util/gnunet-service-resolver.c
@@ -217,7 +217,7 @@ free_cache_entry (struct ResolveCache *rc)
217 GNUNET_free (pos->record); 217 GNUNET_free (pos->record);
218 GNUNET_free (pos); 218 GNUNET_free (pos);
219 } 219 }
220 GNUNET_free_non_null (rc->hostname); 220 GNUNET_free (rc->hostname);
221 GNUNET_CONTAINER_DLL_remove (cache_head, cache_tail, rc); 221 GNUNET_CONTAINER_DLL_remove (cache_head, cache_tail, rc);
222 cache_size--; 222 cache_size--;
223 GNUNET_free (rc); 223 GNUNET_free (rc);
@@ -241,7 +241,7 @@ free_hosts_entry (struct ResolveCache *rc)
241 GNUNET_free (pos->record); 241 GNUNET_free (pos->record);
242 GNUNET_free (pos); 242 GNUNET_free (pos);
243 } 243 }
244 GNUNET_free_non_null (rc->hostname); 244 GNUNET_free (rc->hostname);
245 GNUNET_CONTAINER_DLL_remove (hosts_head, hosts_tail, rc); 245 GNUNET_CONTAINER_DLL_remove (hosts_head, hosts_tail, rc);
246 cache_size--; 246 cache_size--;
247 GNUNET_free (rc); 247 GNUNET_free (rc);
@@ -267,7 +267,7 @@ free_active_lookup (struct ActiveLookup *al)
267 GNUNET_SCHEDULER_cancel (al->timeout_task); 267 GNUNET_SCHEDULER_cancel (al->timeout_task);
268 al->timeout_task = NULL; 268 al->timeout_task = NULL;
269 } 269 }
270 GNUNET_free_non_null (al->hostname); 270 GNUNET_free (al->hostname);
271 GNUNET_free (al); 271 GNUNET_free (al);
272} 272}
273 273
@@ -1094,7 +1094,7 @@ handle_get (void *cls, const struct GNUNET_RESOLVER_GetMessage *msg)
1094 client_request_id, 1094 client_request_id,
1095 client); 1095 client);
1096 } 1096 }
1097 GNUNET_free_non_null (hostname); 1097 GNUNET_free (hostname);
1098} 1098}
1099 1099
1100 1100
@@ -1115,7 +1115,7 @@ shutdown_task (void *cls)
1115 while (NULL != hosts_head) 1115 while (NULL != hosts_head)
1116 free_hosts_entry (hosts_head); 1116 free_hosts_entry (hosts_head);
1117 GNUNET_DNSSTUB_stop (dnsstub_ctx); 1117 GNUNET_DNSSTUB_stop (dnsstub_ctx);
1118 GNUNET_free_non_null (my_domain); 1118 GNUNET_free (my_domain);
1119} 1119}
1120 1120
1121 1121
@@ -1296,7 +1296,7 @@ init_cb (void *cls,
1296 GNUNET_OK == result ? "success" : "failure"); 1296 GNUNET_OK == result ? "success" : "failure");
1297 GNUNET_free (dns_servers[i]); 1297 GNUNET_free (dns_servers[i]);
1298 } 1298 }
1299 GNUNET_free_non_null (dns_servers); 1299 GNUNET_free (dns_servers);
1300} 1300}
1301 1301
1302 1302
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c
index 48c46ee49..9443c9120 100644
--- a/src/util/gnunet-uri.c
+++ b/src/util/gnunet-uri.c
@@ -115,8 +115,7 @@ run (void *cls,
115 GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ), 115 GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ),
116 &maint_child_death, 116 &maint_child_death,
117 NULL); 117 NULL);
118 p = GNUNET_OS_start_process (GNUNET_NO, 118 p = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE,
119 0,
120 NULL, 119 NULL,
121 NULL, 120 NULL,
122 NULL, 121 NULL,
@@ -168,7 +167,7 @@ main (int argc, char *const *argv)
168 167
169 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 168 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
170 return 2; 169 return 2;
171 sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); 170 sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
172 GNUNET_assert (sigpipe != NULL); 171 GNUNET_assert (sigpipe != NULL);
173 shc_chld = 172 shc_chld =
174 GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death); 173 GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death);
diff --git a/src/util/helper.c b/src/util/helper.c
index 8c8fb7b6a..7360b7d4b 100644
--- a/src/util/helper.c
+++ b/src/util/helper.c
@@ -401,9 +401,9 @@ static void
401start_helper (struct GNUNET_HELPER_Handle *h) 401start_helper (struct GNUNET_HELPER_Handle *h)
402{ 402{
403 h->helper_in = 403 h->helper_in =
404 GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO); 404 GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
405 h->helper_out = 405 h->helper_out =
406 GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); 406 GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
407 if ((h->helper_in == NULL) || (h->helper_out == NULL)) 407 if ((h->helper_in == NULL) || (h->helper_out == NULL))
408 { 408 {
409 /* out of file descriptors? try again later... */ 409 /* out of file descriptors? try again later... */
@@ -422,8 +422,10 @@ start_helper (struct GNUNET_HELPER_Handle *h)
422 GNUNET_DISK_pipe_handle (h->helper_out, GNUNET_DISK_PIPE_END_READ); 422 GNUNET_DISK_pipe_handle (h->helper_out, GNUNET_DISK_PIPE_END_READ);
423 h->fh_to_helper = 423 h->fh_to_helper =
424 GNUNET_DISK_pipe_handle (h->helper_in, GNUNET_DISK_PIPE_END_WRITE); 424 GNUNET_DISK_pipe_handle (h->helper_in, GNUNET_DISK_PIPE_END_WRITE);
425 h->helper_proc = GNUNET_OS_start_process_vap (h->with_control_pipe, 425 h->helper_proc = GNUNET_OS_start_process_vap (h->with_control_pipe
426 GNUNET_OS_INHERIT_STD_ERR, 426 ? GNUNET_OS_INHERIT_STD_ERR
427 | GNUNET_OS_USE_PIPE_CONTROL
428 : GNUNET_OS_INHERIT_STD_ERR,
427 h->helper_in, 429 h->helper_in,
428 h->helper_out, 430 h->helper_out,
429 NULL, 431 NULL,
diff --git a/src/util/mq.c b/src/util/mq.c
index 78dc7dba2..302b310de 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -881,7 +881,7 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq)
881 GNUNET_CONTAINER_multihashmap32_destroy (mq->assoc_map); 881 GNUNET_CONTAINER_multihashmap32_destroy (mq->assoc_map);
882 mq->assoc_map = NULL; 882 mq->assoc_map = NULL;
883 } 883 }
884 GNUNET_free_non_null (mq->handlers); 884 GNUNET_free (mq->handlers);
885 GNUNET_free (mq); 885 GNUNET_free (mq);
886} 886}
887 887
diff --git a/src/util/network.c b/src/util/network.c
index 223ce2080..b18030fcd 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -621,7 +621,7 @@ GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc)
621void 621void
622GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc) 622GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc)
623{ 623{
624 GNUNET_free_non_null (desc->addr); 624 GNUNET_free (desc->addr);
625 GNUNET_free (desc); 625 GNUNET_free (desc);
626} 626}
627 627
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index 714df6957..34b88d761 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -563,11 +563,11 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind)
563 (GNUNET_YES == GNUNET_DISK_directory_test (tmp, GNUNET_YES))) 563 (GNUNET_YES == GNUNET_DISK_directory_test (tmp, GNUNET_YES)))
564 { 564 {
565 GNUNET_free (execpath); 565 GNUNET_free (execpath);
566 GNUNET_free_non_null (dirname); 566 GNUNET_free (dirname);
567 return tmp; 567 return tmp;
568 } 568 }
569 GNUNET_free (tmp); 569 GNUNET_free (tmp);
570 GNUNET_free_non_null (dirname); 570 GNUNET_free (dirname);
571 } 571 }
572 GNUNET_asprintf (&dirname, 572 GNUNET_asprintf (&dirname,
573 DIR_SEPARATOR_STR "%s" DIR_SEPARATOR_STR, 573 DIR_SEPARATOR_STR "%s" DIR_SEPARATOR_STR,
@@ -643,11 +643,11 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind)
643 (GNUNET_YES == GNUNET_DISK_directory_test (tmp, GNUNET_YES))) 643 (GNUNET_YES == GNUNET_DISK_directory_test (tmp, GNUNET_YES)))
644 { 644 {
645 GNUNET_free (execpath); 645 GNUNET_free (execpath);
646 GNUNET_free_non_null (dirname); 646 GNUNET_free (dirname);
647 return tmp; 647 return tmp;
648 } 648 }
649 GNUNET_free (tmp); 649 GNUNET_free (tmp);
650 GNUNET_free_non_null (dirname); 650 GNUNET_free (dirname);
651 } 651 }
652 GNUNET_asprintf (&dirname, 652 GNUNET_asprintf (&dirname,
653 DIR_SEPARATOR_STR "%s" DIR_SEPARATOR_STR 653 DIR_SEPARATOR_STR "%s" DIR_SEPARATOR_STR
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index 5799d893b..8d045c72b 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -326,7 +326,6 @@ open_dev_null (int target_fd, int flags)
326/** 326/**
327 * Start a process. 327 * Start a process.
328 * 328 *
329 * @param pipe_control should a pipe be used to send signals to the child?
330 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags controlling which 329 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags controlling which
331 * std handles of the parent are inherited by the child. 330 * std handles of the parent are inherited by the child.
332 * pipe_stdin and pipe_stdout take priority over std_inheritance 331 * pipe_stdin and pipe_stdout take priority over std_inheritance
@@ -341,8 +340,7 @@ open_dev_null (int target_fd, int flags)
341 * @return process ID of the new process, -1 on error 340 * @return process ID of the new process, -1 on error
342 */ 341 */
343static struct GNUNET_OS_Process * 342static struct GNUNET_OS_Process *
344start_process (int pipe_control, 343start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
345 enum GNUNET_OS_InheritStdioFlags std_inheritance,
346 struct GNUNET_DISK_PipeHandle *pipe_stdin, 344 struct GNUNET_DISK_PipeHandle *pipe_stdin,
347 struct GNUNET_DISK_PipeHandle *pipe_stdout, 345 struct GNUNET_DISK_PipeHandle *pipe_stdout,
348 struct GNUNET_DISK_PipeHandle *pipe_stderr, 346 struct GNUNET_DISK_PipeHandle *pipe_stderr,
@@ -373,12 +371,12 @@ start_process (int pipe_control,
373 if (GNUNET_SYSERR == 371 if (GNUNET_SYSERR ==
374 GNUNET_OS_check_helper_binary (filename, GNUNET_NO, NULL)) 372 GNUNET_OS_check_helper_binary (filename, GNUNET_NO, NULL))
375 return NULL; /* not executable */ 373 return NULL; /* not executable */
376 if (GNUNET_YES == pipe_control) 374 if (0 != (std_inheritance & GNUNET_OS_USE_PIPE_CONTROL))
377 { 375 {
378 struct GNUNET_DISK_PipeHandle *childpipe; 376 struct GNUNET_DISK_PipeHandle *childpipe;
379 int dup_childpipe_read_fd = -1; 377 int dup_childpipe_read_fd = -1;
380 378
381 childpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_YES, GNUNET_NO); 379 childpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
382 if (NULL == childpipe) 380 if (NULL == childpipe)
383 return NULL; 381 return NULL;
384 childpipe_read = 382 childpipe_read =
@@ -486,7 +484,7 @@ start_process (int pipe_control,
486 gnunet_proc = GNUNET_new (struct GNUNET_OS_Process); 484 gnunet_proc = GNUNET_new (struct GNUNET_OS_Process);
487 gnunet_proc->pid = ret; 485 gnunet_proc->pid = ret;
488 gnunet_proc->control_pipe = childpipe_write; 486 gnunet_proc->control_pipe = childpipe_write;
489 if (GNUNET_YES == pipe_control) 487 if (0 != (std_inheritance & GNUNET_OS_USE_PIPE_CONTROL))
490 { 488 {
491 close (childpipe_read_fd); 489 close (childpipe_read_fd);
492 } 490 }
@@ -594,7 +592,6 @@ start_process (int pipe_control,
594/** 592/**
595 * Start a process. 593 * Start a process.
596 * 594 *
597 * @param pipe_control should a pipe be used to send signals to the child?
598 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags 595 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
599 * @param pipe_stdin pipe to use to send input to child process (or NULL) 596 * @param pipe_stdin pipe to use to send input to child process (or NULL)
600 * @param pipe_stdout pipe to use to get output from child process (or NULL) 597 * @param pipe_stdout pipe to use to get output from child process (or NULL)
@@ -604,16 +601,14 @@ start_process (int pipe_control,
604 * @return pointer to process structure of the new process, NULL on error 601 * @return pointer to process structure of the new process, NULL on error
605 */ 602 */
606struct GNUNET_OS_Process * 603struct GNUNET_OS_Process *
607GNUNET_OS_start_process_vap (int pipe_control, 604GNUNET_OS_start_process_vap (enum GNUNET_OS_InheritStdioFlags std_inheritance,
608 enum GNUNET_OS_InheritStdioFlags std_inheritance,
609 struct GNUNET_DISK_PipeHandle *pipe_stdin, 605 struct GNUNET_DISK_PipeHandle *pipe_stdin,
610 struct GNUNET_DISK_PipeHandle *pipe_stdout, 606 struct GNUNET_DISK_PipeHandle *pipe_stdout,
611 struct GNUNET_DISK_PipeHandle *pipe_stderr, 607 struct GNUNET_DISK_PipeHandle *pipe_stderr,
612 const char *filename, 608 const char *filename,
613 char *const argv[]) 609 char *const argv[])
614{ 610{
615 return start_process (pipe_control, 611 return start_process (std_inheritance,
616 std_inheritance,
617 pipe_stdin, 612 pipe_stdin,
618 pipe_stdout, 613 pipe_stdout,
619 pipe_stderr, 614 pipe_stderr,
@@ -626,7 +621,6 @@ GNUNET_OS_start_process_vap (int pipe_control,
626/** 621/**
627 * Start a process. 622 * Start a process.
628 * 623 *
629 * @param pipe_control should a pipe be used to send signals to the child?
630 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags 624 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
631 * @param pipe_stdin pipe to use to send input to child process (or NULL) 625 * @param pipe_stdin pipe to use to send input to child process (or NULL)
632 * @param pipe_stdout pipe to use to get output from child process (or NULL) 626 * @param pipe_stdout pipe to use to get output from child process (or NULL)
@@ -636,8 +630,7 @@ GNUNET_OS_start_process_vap (int pipe_control,
636 * @return pointer to process structure of the new process, NULL on error 630 * @return pointer to process structure of the new process, NULL on error
637 */ 631 */
638struct GNUNET_OS_Process * 632struct GNUNET_OS_Process *
639GNUNET_OS_start_process_va (int pipe_control, 633GNUNET_OS_start_process_va (enum GNUNET_OS_InheritStdioFlags std_inheritance,
640 enum GNUNET_OS_InheritStdioFlags std_inheritance,
641 struct GNUNET_DISK_PipeHandle *pipe_stdin, 634 struct GNUNET_DISK_PipeHandle *pipe_stdin,
642 struct GNUNET_DISK_PipeHandle *pipe_stdout, 635 struct GNUNET_DISK_PipeHandle *pipe_stdout,
643 struct GNUNET_DISK_PipeHandle *pipe_stderr, 636 struct GNUNET_DISK_PipeHandle *pipe_stderr,
@@ -660,8 +653,7 @@ GNUNET_OS_start_process_va (int pipe_control,
660 while (NULL != (argv[argc] = va_arg (ap, char *))) 653 while (NULL != (argv[argc] = va_arg (ap, char *)))
661 argc++; 654 argc++;
662 va_end (ap); 655 va_end (ap);
663 ret = GNUNET_OS_start_process_vap (pipe_control, 656 ret = GNUNET_OS_start_process_vap (std_inheritance,
664 std_inheritance,
665 pipe_stdin, 657 pipe_stdin,
666 pipe_stdout, 658 pipe_stdout,
667 pipe_stderr, 659 pipe_stderr,
@@ -675,7 +667,6 @@ GNUNET_OS_start_process_va (int pipe_control,
675/** 667/**
676 * Start a process. 668 * Start a process.
677 * 669 *
678 * @param pipe_control should a pipe be used to send signals to the child?
679 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags 670 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
680 * @param pipe_stdin pipe to use to send input to child process (or NULL) 671 * @param pipe_stdin pipe to use to send input to child process (or NULL)
681 * @param pipe_stdout pipe to use to get output from child process (or NULL) 672 * @param pipe_stdout pipe to use to get output from child process (or NULL)
@@ -684,8 +675,7 @@ GNUNET_OS_start_process_va (int pipe_control,
684 * @return pointer to process structure of the new process, NULL on error 675 * @return pointer to process structure of the new process, NULL on error
685 */ 676 */
686struct GNUNET_OS_Process * 677struct GNUNET_OS_Process *
687GNUNET_OS_start_process (int pipe_control, 678GNUNET_OS_start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
688 enum GNUNET_OS_InheritStdioFlags std_inheritance,
689 struct GNUNET_DISK_PipeHandle *pipe_stdin, 679 struct GNUNET_DISK_PipeHandle *pipe_stdin,
690 struct GNUNET_DISK_PipeHandle *pipe_stdout, 680 struct GNUNET_DISK_PipeHandle *pipe_stdout,
691 struct GNUNET_DISK_PipeHandle *pipe_stderr, 681 struct GNUNET_DISK_PipeHandle *pipe_stderr,
@@ -696,8 +686,7 @@ GNUNET_OS_start_process (int pipe_control,
696 va_list ap; 686 va_list ap;
697 687
698 va_start (ap, filename); 688 va_start (ap, filename);
699 ret = GNUNET_OS_start_process_va (pipe_control, 689 ret = GNUNET_OS_start_process_va (std_inheritance,
700 std_inheritance,
701 pipe_stdin, 690 pipe_stdin,
702 pipe_stdout, 691 pipe_stdout,
703 pipe_stderr, 692 pipe_stderr,
@@ -711,7 +700,6 @@ GNUNET_OS_start_process (int pipe_control,
711/** 700/**
712 * Start a process. 701 * Start a process.
713 * 702 *
714 * @param pipe_control should a pipe be used to send signals to the child?
715 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags controlling which 703 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags controlling which
716 * std handles of the parent are inherited by the child. 704 * std handles of the parent are inherited by the child.
717 * pipe_stdin and pipe_stdout take priority over std_inheritance 705 * pipe_stdin and pipe_stdout take priority over std_inheritance
@@ -723,14 +711,12 @@ GNUNET_OS_start_process (int pipe_control,
723 * @return process ID of the new process, -1 on error 711 * @return process ID of the new process, -1 on error
724 */ 712 */
725struct GNUNET_OS_Process * 713struct GNUNET_OS_Process *
726GNUNET_OS_start_process_v (int pipe_control, 714GNUNET_OS_start_process_v (enum GNUNET_OS_InheritStdioFlags std_inheritance,
727 enum GNUNET_OS_InheritStdioFlags std_inheritance,
728 const int *lsocks, 715 const int *lsocks,
729 const char *filename, 716 const char *filename,
730 char *const argv[]) 717 char *const argv[])
731{ 718{
732 return start_process (pipe_control, 719 return start_process (std_inheritance,
733 std_inheritance,
734 NULL, 720 NULL,
735 NULL, 721 NULL,
736 NULL, 722 NULL,
@@ -747,7 +733,6 @@ GNUNET_OS_start_process_v (int pipe_control,
747 * in the order they appear. Arguments containing spaces can be used by 733 * in the order they appear. Arguments containing spaces can be used by
748 * quoting them with @em ". 734 * quoting them with @em ".
749 * 735 *
750 * @param pipe_control should a pipe be used to send signals to the child?
751 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags 736 * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
752 * @param lsocks array of listen sockets to dup systemd-style (or NULL); 737 * @param lsocks array of listen sockets to dup systemd-style (or NULL);
753 * must be NULL on platforms where dup is not supported 738 * must be NULL on platforms where dup is not supported
@@ -759,8 +744,7 @@ GNUNET_OS_start_process_v (int pipe_control,
759 * @return pointer to process structure of the new process, NULL on error 744 * @return pointer to process structure of the new process, NULL on error
760 */ 745 */
761struct GNUNET_OS_Process * 746struct GNUNET_OS_Process *
762GNUNET_OS_start_process_s (int pipe_control, 747GNUNET_OS_start_process_s (enum GNUNET_OS_InheritStdioFlags std_inheritance,
763 unsigned int std_inheritance,
764 const int *lsocks, 748 const int *lsocks,
765 const char *filename, 749 const char *filename,
766 ...) 750 ...)
@@ -869,8 +853,7 @@ GNUNET_OS_start_process_s (int pipe_control,
869 } 853 }
870 } 854 }
871 binary_path = argv[0]; 855 binary_path = argv[0];
872 proc = GNUNET_OS_start_process_v (pipe_control, 856 proc = GNUNET_OS_start_process_v (std_inheritance,
873 std_inheritance,
874 lsocks, 857 lsocks,
875 binary_path, 858 binary_path,
876 argv); 859 argv);
@@ -1169,13 +1152,18 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc,
1169 struct GNUNET_DISK_PipeHandle *opipe; 1152 struct GNUNET_DISK_PipeHandle *opipe;
1170 va_list ap; 1153 va_list ap;
1171 1154
1172 opipe = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); 1155 opipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
1173 if (NULL == opipe) 1156 if (NULL == opipe)
1174 return NULL; 1157 return NULL;
1175 va_start (ap, binary); 1158 va_start (ap, binary);
1176 /* redirect stdout, don't inherit stderr/stdin */ 1159 /* redirect stdout, don't inherit stderr/stdin */
1177 eip = 1160 eip =
1178 GNUNET_OS_start_process_va (GNUNET_NO, 0, NULL, opipe, NULL, binary, ap); 1161 GNUNET_OS_start_process_va (GNUNET_OS_INHERIT_STD_NONE,
1162 NULL,
1163 opipe,
1164 NULL,
1165 binary,
1166 ap);
1179 va_end (ap); 1167 va_end (ap);
1180 if (NULL == eip) 1168 if (NULL == eip)
1181 { 1169 {
diff --git a/src/util/perf_malloc.c b/src/util/perf_malloc.c
index 6582505c8..1c91402da 100644
--- a/src/util/perf_malloc.c
+++ b/src/util/perf_malloc.c
@@ -56,11 +56,11 @@ perf_realloc ()
56 ptr = GNUNET_malloc (i); 56 ptr = GNUNET_malloc (i);
57 memset (ptr, 1, i); 57 memset (ptr, 1, i);
58 ptr = GNUNET_realloc (ptr, i + 5); 58 ptr = GNUNET_realloc (ptr, i + 5);
59 for (size_t j=0;j<i;j++) 59 for (size_t j = 0; j<i; j++)
60 GNUNET_assert (1 == ptr[j]); 60 GNUNET_assert (1 == ptr[j]);
61 memset (ptr, 6, i + 5); 61 memset (ptr, 6, i + 5);
62 ptr = GNUNET_realloc (ptr, i - 5); 62 ptr = GNUNET_realloc (ptr, i - 5);
63 for (size_t j=0;j<i-5;j++) 63 for (size_t j = 0; j<i - 5; j++)
64 GNUNET_assert (6 == ptr[j]); 64 GNUNET_assert (6 == ptr[j]);
65 GNUNET_free (ptr); 65 GNUNET_free (ptr);
66 } 66 }
diff --git a/src/util/perf_scheduler.c b/src/util/perf_scheduler.c
index 3ea76e24c..4d4d0a228 100644
--- a/src/util/perf_scheduler.c
+++ b/src/util/perf_scheduler.c
@@ -94,8 +94,8 @@ main (int argc, char *argv[])
94 GNUNET_YES)); 94 GNUNET_YES));
95 GAUGER ("UTIL", "Scheduler", 95 GAUGER ("UTIL", "Scheduler",
96 tasks / 1024 / (1 96 tasks / 1024 / (1
97 + GNUNET_TIME_absolute_get_duration 97 + GNUNET_TIME_absolute_get_duration
98 (start).rel_value_us / 1000LL), "tasks/ms"); 98 (start).rel_value_us / 1000LL), "tasks/ms");
99 return 0; 99 return 0;
100} 100}
101 101
diff --git a/src/util/program.c b/src/util/program.c
index 5ad069edd..8bda34b4f 100644
--- a/src/util/program.c
+++ b/src/util/program.c
@@ -342,10 +342,10 @@ GNUNET_PROGRAM_run2 (int argc,
342 ret = GNUNET_OK; 342 ret = GNUNET_OK;
343cleanup: 343cleanup:
344 GNUNET_CONFIGURATION_destroy (cfg); 344 GNUNET_CONFIGURATION_destroy (cfg);
345 GNUNET_free_non_null (cc.cfgfile); 345 GNUNET_free (cc.cfgfile);
346 GNUNET_free_non_null (cfg_fn); 346 GNUNET_free (cfg_fn);
347 GNUNET_free_non_null (loglev); 347 GNUNET_free (loglev);
348 GNUNET_free_non_null (logfile); 348 GNUNET_free (logfile);
349 return ret; 349 return ret;
350} 350}
351 351
diff --git a/src/util/regex.c b/src/util/regex.c
index d3ab35652..fed325cd6 100644
--- a/src/util/regex.c
+++ b/src/util/regex.c
@@ -174,10 +174,10 @@ num_to_regex (uint16_t value,
174 GNUNET_asprintf (&ret, 174 GNUNET_asprintf (&ret,
175 "%s%s%s%s", 175 "%s%s%s%s",
176 a, b, c, d); 176 a, b, c, d);
177 GNUNET_free_non_null (a); 177 GNUNET_free (a);
178 GNUNET_free_non_null (b); 178 GNUNET_free (b);
179 GNUNET_free_non_null (c); 179 GNUNET_free (c);
180 GNUNET_free_non_null (d); 180 GNUNET_free (d);
181 return ret; 181 return ret;
182} 182}
183 183
@@ -607,7 +607,7 @@ address_to_regex (const void *addr,
607 reg = num_to_regex (a[i], m[i]); 607 reg = num_to_regex (a[i], m[i]);
608 if (NULL == reg) 608 if (NULL == reg)
609 { 609 {
610 GNUNET_free_non_null (ret); 610 GNUNET_free (ret);
611 return NULL; 611 return NULL;
612 } 612 }
613 if (NULL == ret) 613 if (NULL == ret)
@@ -721,7 +721,7 @@ GNUNET_TUN_ipv4policy2regex (const char *policy)
721 line = ipv4_to_regex (&np[i]); 721 line = ipv4_to_regex (&np[i]);
722 if (NULL == line) 722 if (NULL == line)
723 { 723 {
724 GNUNET_free_non_null (reg); 724 GNUNET_free (reg);
725 GNUNET_free (np); 725 GNUNET_free (np);
726 return NULL; 726 return NULL;
727 } 727 }
@@ -777,7 +777,7 @@ GNUNET_TUN_ipv6policy2regex (const char *policy)
777 line = ipv6_to_regex (&np[i]); 777 line = ipv6_to_regex (&np[i]);
778 if (NULL == line) 778 if (NULL == line)
779 { 779 {
780 GNUNET_free_non_null (reg); 780 GNUNET_free (reg);
781 GNUNET_free (np); 781 GNUNET_free (np);
782 return NULL; 782 return NULL;
783 } 783 }
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 93393bd7c..b5ce20254 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -2214,10 +2214,7 @@ GNUNET_SCHEDULER_driver_init (const struct GNUNET_SCHEDULER_Driver *driver)
2214 GNUNET_assert (NULL == shutdown_pipe_handle); 2214 GNUNET_assert (NULL == shutdown_pipe_handle);
2215 /* general set-up */ 2215 /* general set-up */
2216 sh = GNUNET_new (struct GNUNET_SCHEDULER_Handle); 2216 sh = GNUNET_new (struct GNUNET_SCHEDULER_Handle);
2217 shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_NO, 2217 shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
2218 GNUNET_NO,
2219 GNUNET_NO,
2220 GNUNET_NO);
2221 GNUNET_assert (NULL != shutdown_pipe_handle); 2218 GNUNET_assert (NULL != shutdown_pipe_handle);
2222 pr = GNUNET_DISK_pipe_handle (shutdown_pipe_handle, 2219 pr = GNUNET_DISK_pipe_handle (shutdown_pipe_handle,
2223 GNUNET_DISK_PIPE_END_READ); 2220 GNUNET_DISK_PIPE_END_READ);
diff --git a/src/util/service.c b/src/util/service.c
index ea078b19b..e6bbe855f 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -1144,7 +1144,7 @@ get_server_addresses (const char *service_name,
1144 (EACCES == errno)) 1144 (EACCES == errno))
1145 { 1145 {
1146 LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket"); 1146 LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket");
1147 GNUNET_free_non_null (hostname); 1147 GNUNET_free (hostname);
1148 GNUNET_free (unixpath); 1148 GNUNET_free (unixpath);
1149 return GNUNET_SYSERR; 1149 return GNUNET_SYSERR;
1150 } 1150 }
@@ -1170,7 +1170,7 @@ get_server_addresses (const char *service_name,
1170 _ ( 1170 _ (
1171 "Have neither PORT nor UNIXPATH for service `%s', but one is required\n"), 1171 "Have neither PORT nor UNIXPATH for service `%s', but one is required\n"),
1172 service_name); 1172 service_name);
1173 GNUNET_free_non_null (hostname); 1173 GNUNET_free (hostname);
1174 return GNUNET_SYSERR; 1174 return GNUNET_SYSERR;
1175 } 1175 }
1176 if (0 == port) 1176 if (0 == port)
@@ -1178,8 +1178,8 @@ get_server_addresses (const char *service_name,
1178 saddrs = GNUNET_new_array (2, struct sockaddr *); 1178 saddrs = GNUNET_new_array (2, struct sockaddr *);
1179 saddrlens = GNUNET_new_array (2, socklen_t); 1179 saddrlens = GNUNET_new_array (2, socklen_t);
1180 add_unixpath (saddrs, saddrlens, unixpath); 1180 add_unixpath (saddrs, saddrlens, unixpath);
1181 GNUNET_free_non_null (unixpath); 1181 GNUNET_free (unixpath);
1182 GNUNET_free_non_null (hostname); 1182 GNUNET_free (hostname);
1183 *addrs = saddrs; 1183 *addrs = saddrs;
1184 *addr_lens = saddrlens; 1184 *addr_lens = saddrlens;
1185 return 1; 1185 return 1;
@@ -1203,7 +1203,7 @@ get_server_addresses (const char *service_name,
1203 hostname, 1203 hostname,
1204 gai_strerror (ret)); 1204 gai_strerror (ret));
1205 GNUNET_free (hostname); 1205 GNUNET_free (hostname);
1206 GNUNET_free_non_null (unixpath); 1206 GNUNET_free (unixpath);
1207 return GNUNET_SYSERR; 1207 return GNUNET_SYSERR;
1208 } 1208 }
1209 next = res; 1209 next = res;
@@ -1223,7 +1223,7 @@ get_server_addresses (const char *service_name,
1223 hostname); 1223 hostname);
1224 freeaddrinfo (res); 1224 freeaddrinfo (res);
1225 GNUNET_free (hostname); 1225 GNUNET_free (hostname);
1226 GNUNET_free_non_null (unixpath); 1226 GNUNET_free (unixpath);
1227 return GNUNET_SYSERR; 1227 return GNUNET_SYSERR;
1228 } 1228 }
1229 resi = i; 1229 resi = i;
@@ -1330,7 +1330,7 @@ get_server_addresses (const char *service_name,
1330 ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port); 1330 ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port);
1331 } 1331 }
1332 } 1332 }
1333 GNUNET_free_non_null (unixpath); 1333 GNUNET_free (unixpath);
1334 *addrs = saddrs; 1334 *addrs = saddrs;
1335 *addr_lens = saddrlens; 1335 *addr_lens = saddrlens;
1336 return resi; 1336 return resi;
@@ -1557,8 +1557,8 @@ setup_service (struct GNUNET_SERVICE_Handle *sh)
1557 } 1557 }
1558 GNUNET_CONTAINER_DLL_insert (sh->slc_head, sh->slc_tail, slc); 1558 GNUNET_CONTAINER_DLL_insert (sh->slc_head, sh->slc_tail, slc);
1559 } 1559 }
1560 GNUNET_free_non_null (addrlens); 1560 GNUNET_free (addrlens);
1561 GNUNET_free_non_null (addrs); 1561 GNUNET_free (addrs);
1562 if ((0 != num) && (NULL == sh->slc_head)) 1562 if ((0 != num) && (NULL == sh->slc_head))
1563 { 1563 {
1564 /* All attempts to bind failed, hard failure */ 1564 /* All attempts to bind failed, hard failure */
@@ -1566,7 +1566,7 @@ setup_service (struct GNUNET_SERVICE_Handle *sh)
1566 GNUNET_ERROR_TYPE_ERROR, 1566 GNUNET_ERROR_TYPE_ERROR,
1567 _ ( 1567 _ (
1568 "Could not bind to any of the ports I was supposed to, refusing to run!\n")); 1568 "Could not bind to any of the ports I was supposed to, refusing to run!\n"));
1569 GNUNET_free_non_null (csocks); 1569 GNUNET_free (csocks);
1570 return GNUNET_SYSERR; 1570 return GNUNET_SYSERR;
1571 } 1571 }
1572 } 1572 }
@@ -1793,10 +1793,10 @@ teardown_service (struct GNUNET_SERVICE_Handle *sh)
1793{ 1793{
1794 struct ServiceListenContext *slc; 1794 struct ServiceListenContext *slc;
1795 1795
1796 GNUNET_free_non_null (sh->v4_denied); 1796 GNUNET_free (sh->v4_denied);
1797 GNUNET_free_non_null (sh->v6_denied); 1797 GNUNET_free (sh->v6_denied);
1798 GNUNET_free_non_null (sh->v4_allowed); 1798 GNUNET_free (sh->v4_allowed);
1799 GNUNET_free_non_null (sh->v6_allowed); 1799 GNUNET_free (sh->v6_allowed);
1800 while (NULL != (slc = sh->slc_head)) 1800 while (NULL != (slc = sh->slc_head))
1801 { 1801 {
1802 GNUNET_CONTAINER_DLL_remove (sh->slc_head, sh->slc_tail, slc); 1802 GNUNET_CONTAINER_DLL_remove (sh->slc_head, sh->slc_tail, slc);
@@ -1890,7 +1890,7 @@ GNUNET_SERVICE_start (const char *service_name,
1890 sh->handlers = GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL); 1890 sh->handlers = GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL);
1891 if (GNUNET_OK != setup_service (sh)) 1891 if (GNUNET_OK != setup_service (sh))
1892 { 1892 {
1893 GNUNET_free_non_null (sh->handlers); 1893 GNUNET_free (sh->handlers);
1894 GNUNET_free (sh); 1894 GNUNET_free (sh);
1895 return NULL; 1895 return NULL;
1896 } 1896 }
@@ -1913,7 +1913,7 @@ GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Handle *srv)
1913 while (NULL != (client = srv->clients_head)) 1913 while (NULL != (client = srv->clients_head))
1914 GNUNET_SERVICE_client_drop (client); 1914 GNUNET_SERVICE_client_drop (client);
1915 teardown_service (srv); 1915 teardown_service (srv);
1916 GNUNET_free_non_null (srv->handlers); 1916 GNUNET_free (srv->handlers);
1917 GNUNET_free (srv); 1917 GNUNET_free (srv);
1918} 1918}
1919 1919
@@ -2021,8 +2021,8 @@ GNUNET_SERVICE_run_ (int argc,
2021 sh.disconnect_cb = disconnect_cb; 2021 sh.disconnect_cb = disconnect_cb;
2022 sh.cb_cls = cls; 2022 sh.cb_cls = cls;
2023 sh.handlers = (NULL == pd->agpl_url) 2023 sh.handlers = (NULL == pd->agpl_url)
2024 ? GNUNET_MQ_copy_handlers (handlers) 2024 ? GNUNET_MQ_copy_handlers (handlers)
2025 : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL); 2025 : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL);
2026 sh.service_name = service_name; 2026 sh.service_name = service_name;
2027 sh.ret = 0; 2027 sh.ret = 0;
2028 /* setup subsystems */ 2028 /* setup subsystems */
@@ -2159,13 +2159,13 @@ shutdown:
2159 } 2159 }
2160#endif 2160#endif
2161 teardown_service (&sh); 2161 teardown_service (&sh);
2162 GNUNET_free_non_null (sh.handlers); 2162 GNUNET_free (sh.handlers);
2163 GNUNET_SPEEDUP_stop_ (); 2163 GNUNET_SPEEDUP_stop_ ();
2164 GNUNET_CONFIGURATION_destroy (cfg); 2164 GNUNET_CONFIGURATION_destroy (cfg);
2165 GNUNET_free_non_null (logfile); 2165 GNUNET_free (logfile);
2166 GNUNET_free_non_null (loglev); 2166 GNUNET_free (loglev);
2167 GNUNET_free (cfg_filename); 2167 GNUNET_free (cfg_filename);
2168 GNUNET_free_non_null (opt_cfg_filename); 2168 GNUNET_free (opt_cfg_filename);
2169 2169
2170 return err ? GNUNET_SYSERR : sh.ret; 2170 return err ? GNUNET_SYSERR : sh.ret;
2171} 2171}
diff --git a/src/util/socks.c b/src/util/socks.c
index 756be753a..7ab297272 100644
--- a/src/util/socks.c
+++ b/src/util/socks.c
@@ -665,7 +665,7 @@ GNUNET_SOCKS_do_connect (const char *service_name,
665 (host0 != NULL) ? host0 665 (host0 != NULL) ? host0
666 : "127.0.0.1", 666 : "127.0.0.1",
667 port0); 667 port0);
668 GNUNET_free_non_null (host0); 668 GNUNET_free (host0);
669 669
670 /* Sets to NULL if they do not exist */ 670 /* Sets to NULL if they do not exist */
671 (void) GNUNET_CONFIGURATION_get_value_string (cfg, 671 (void) GNUNET_CONFIGURATION_get_value_string (cfg,
@@ -677,8 +677,8 @@ GNUNET_SOCKS_do_connect (const char *service_name,
677 "SOCKSPASS", 677 "SOCKSPASS",
678 &pass); 678 &pass);
679 ih = GNUNET_SOCKS_init_handshake (user, pass); 679 ih = GNUNET_SOCKS_init_handshake (user, pass);
680 GNUNET_free_non_null (user); 680 GNUNET_free (user);
681 GNUNET_free_non_null (pass); 681 GNUNET_free (pass);
682 682
683 GNUNET_SOCKS_set_handshake_destination (ih, host1, port1); 683 GNUNET_SOCKS_set_handshake_destination (ih, host1, port1);
684 GNUNET_free (host1); 684 GNUNET_free (host1);
diff --git a/src/util/strings.c b/src/util/strings.c
index 9510b3b3b..41180dd71 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -1148,7 +1148,7 @@ GNUNET_STRINGS_path_is_absolute (const char *filename,
1148 if (r_uri_scheme) 1148 if (r_uri_scheme)
1149 *r_uri_scheme = uri; 1149 *r_uri_scheme = uri;
1150 else 1150 else
1151 GNUNET_free_non_null (uri); 1151 GNUNET_free (uri);
1152 1152
1153 return GNUNET_STRINGS_path_is_absolute (post_scheme_path, 1153 return GNUNET_STRINGS_path_is_absolute (post_scheme_path,
1154 GNUNET_NO, 1154 GNUNET_NO,
@@ -1985,7 +1985,7 @@ GNUNET_STRINGS_base64_decode (const char *data, size_t len, void **out)
1985 "ignoring CR/LF\n"); \ 1985 "ignoring CR/LF\n"); \
1986 i++; \ 1986 i++; \
1987 if (i >= len) \ 1987 if (i >= len) \
1988 goto END; \ 1988 goto END; \
1989 } 1989 }
1990 1990
1991 GNUNET_assert (len / 3 < SIZE_MAX); 1991 GNUNET_assert (len / 3 < SIZE_MAX);
diff --git a/src/util/test_bio.c b/src/util/test_bio.c
index 0c8453121..f18014719 100644
--- a/src/util/test_bio.c
+++ b/src/util/test_bio.c
@@ -52,14 +52,14 @@ test_normal_rw (void)
52 GNUNET_BIO_write_spec_string ("test-normal-rw-string", TESTSTRING), 52 GNUNET_BIO_write_spec_string ("test-normal-rw-string", TESTSTRING),
53 GNUNET_BIO_write_spec_meta_data ("test-normal-rw-metadata", mdW), 53 GNUNET_BIO_write_spec_meta_data ("test-normal-rw-metadata", mdW),
54 GNUNET_BIO_write_spec_int64 ("test-normal-rw-int64", &wNum), 54 GNUNET_BIO_write_spec_int64 ("test-normal-rw-int64", &wNum),
55 GNUNET_BIO_write_spec_end(), 55 GNUNET_BIO_write_spec_end (),
56 }; 56 };
57 57
58 struct GNUNET_BIO_ReadSpec rs[] = { 58 struct GNUNET_BIO_ReadSpec rs[] = {
59 GNUNET_BIO_read_spec_string ("test-normal-rw-string", &rString, 200), 59 GNUNET_BIO_read_spec_string ("test-normal-rw-string", &rString, 200),
60 GNUNET_BIO_read_spec_meta_data ("test-normal-rw-metadata", &mdR), 60 GNUNET_BIO_read_spec_meta_data ("test-normal-rw-metadata", &mdR),
61 GNUNET_BIO_read_spec_int64 ("test-normal-rw-int64", &rNum), 61 GNUNET_BIO_read_spec_int64 ("test-normal-rw-int64", &rNum),
62 GNUNET_BIO_read_spec_end(), 62 GNUNET_BIO_read_spec_end (),
63 }; 63 };
64 64
65 /* I/O on file */ 65 /* I/O on file */
@@ -73,12 +73,13 @@ test_normal_rw (void)
73 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_spec_commit (rh, rs)); 73 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_spec_commit (rh, rs));
74 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_close (rh, NULL)); 74 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_close (rh, NULL));
75 GNUNET_assert (0 == strcmp (TESTSTRING, rString)); 75 GNUNET_assert (0 == strcmp (TESTSTRING, rString));
76 GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR, mdW)); 76 GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR,
77 mdW));
77 GNUNET_assert (wNum == rNum); 78 GNUNET_assert (wNum == rNum);
78 79
79 GNUNET_CONTAINER_meta_data_destroy (mdR); 80 GNUNET_CONTAINER_meta_data_destroy (mdR);
80 GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (filename)); 81 GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (filename));
81 GNUNET_free(filename); 82 GNUNET_free (filename);
82 83
83 /* I/O on buffer */ 84 /* I/O on buffer */
84 wh = GNUNET_BIO_write_open_buffer (); 85 wh = GNUNET_BIO_write_open_buffer ();
@@ -96,7 +97,8 @@ test_normal_rw (void)
96 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_spec_commit (rh, rs)); 97 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_spec_commit (rh, rs));
97 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_close (rh, NULL)); 98 GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_close (rh, NULL));
98 GNUNET_assert (0 == strcmp (TESTSTRING, rString)); 99 GNUNET_assert (0 == strcmp (TESTSTRING, rString));
99 GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR, mdW)); 100 GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR,
101 mdW));
100 GNUNET_assert (wNum == rNum); 102 GNUNET_assert (wNum == rNum);
101 103
102 GNUNET_free (buffer); 104 GNUNET_free (buffer);
@@ -314,7 +316,7 @@ test_fullfile_rw (void)
314 200), 316 200),
315 GNUNET_BIO_read_spec_meta_data ("test-fullfile-rw-metadata", 317 GNUNET_BIO_read_spec_meta_data ("test-fullfile-rw-metadata",
316 &mdR), 318 &mdR),
317 GNUNET_BIO_read_spec_end(), 319 GNUNET_BIO_read_spec_end (),
318 }; 320 };
319 321
320 wh = GNUNET_BIO_write_open_file ("/dev/full"); 322 wh = GNUNET_BIO_write_open_file ("/dev/full");
diff --git a/src/util/test_common_allocation.c b/src/util/test_common_allocation.c
index a24af7124..50f259257 100644
--- a/src/util/test_common_allocation.c
+++ b/src/util/test_common_allocation.c
@@ -33,6 +33,7 @@ check (void)
33 char *ptrs[MAX_TESTVAL]; 33 char *ptrs[MAX_TESTVAL];
34 unsigned int **a2; 34 unsigned int **a2;
35 char ***a3; 35 char ***a3;
36 char *tmp;
36 int i; 37 int i;
37 int j; 38 int j;
38 int k; 39 int k;
@@ -55,9 +56,9 @@ check (void)
55 GNUNET_free (ptrs[i]); 56 GNUNET_free (ptrs[i]);
56 } 57 }
57 58
58 /* GNUNET_free_non_null test */ 59 /* GNUNET_free test */
59 GNUNET_free_non_null (NULL); 60 tmp = GNUNET_malloc (4);
60 GNUNET_free_non_null (GNUNET_malloc (4)); 61 GNUNET_free (tmp);
61 62
62 /* GNUNET_strdup tests */ 63 /* GNUNET_strdup tests */
63 ptrs[0] = GNUNET_strdup ("bar"); 64 ptrs[0] = GNUNET_strdup ("bar");
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c
index e6d83d52c..79cf9d53a 100644
--- a/src/util/test_common_logging_runtime_loglevels.c
+++ b/src/util/test_common_logging_runtime_loglevels.c
@@ -207,7 +207,7 @@ read_output_line (int phase_from1, int phase_to1, int phase_from2,
207 */ 207 */
208#define LOG_MAX_LINE_LENGTH (17) 208#define LOG_MAX_LINE_LENGTH (17)
209 209
210#define LOG_BUFFER_SIZE LOG_MAX_NUM_LINES * LOG_MAX_LINE_LENGTH 210#define LOG_BUFFER_SIZE LOG_MAX_NUM_LINES *LOG_MAX_LINE_LENGTH
211 211
212static char buf[LOG_BUFFER_SIZE]; 212static char buf[LOG_BUFFER_SIZE];
213 213
@@ -347,8 +347,7 @@ runone ()
347{ 347{
348 const struct GNUNET_DISK_FileHandle *stdout_read_handle; 348 const struct GNUNET_DISK_FileHandle *stdout_read_handle;
349 349
350 pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, 350 pipe_stdout = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW);
351 GNUNET_YES);
352 351
353 if (pipe_stdout == NULL) 352 if (pipe_stdout == NULL)
354 { 353 {
@@ -403,7 +402,7 @@ runone ()
403 break; 402 break;
404 } 403 }
405 404
406 proc = GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, 405 proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
407 NULL, pipe_stdout, NULL, 406 NULL, pipe_stdout, NULL,
408 "./test_common_logging_dummy", 407 "./test_common_logging_dummy",
409 "test_common_logging_dummy", NULL); 408 "test_common_logging_dummy", NULL);
diff --git a/src/util/test_configuration.c b/src/util/test_configuration.c
index 6227a28db..59b1b2291 100644
--- a/src/util/test_configuration.c
+++ b/src/util/test_configuration.c
@@ -128,7 +128,7 @@ diffsCallBack (void *cls, const char *section, const char *option,
128 } 128 }
129 else 129 else
130 cbData->status = 1; 130 cbData->status = 1;
131 GNUNET_free_non_null (diffValue); 131 GNUNET_free (diffValue);
132 break; 132 break;
133 } 133 }
134 134
diff --git a/src/util/test_container_meta_data.c b/src/util/test_container_meta_data.c
index d768f3699..db413f313 100644
--- a/src/util/test_container_meta_data.c
+++ b/src/util/test_container_meta_data.c
@@ -113,7 +113,7 @@ testMeta (int i)
113 GNUNET_CONTAINER_meta_data_serialize (m, &sval, size, 113 GNUNET_CONTAINER_meta_data_serialize (m, &sval, size,
114 GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL)) 114 GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL))
115 { 115 {
116 GNUNET_free_non_null (sval); 116 GNUNET_free (sval);
117 ABORT (m); 117 ABORT (m);
118 } 118 }
119 GNUNET_CONTAINER_meta_data_destroy (m); 119 GNUNET_CONTAINER_meta_data_destroy (m);
diff --git a/src/util/test_container_multihashmap.c b/src/util/test_container_multihashmap.c
index bd9e7af31..f46b9f56e 100644
--- a/src/util/test_container_multihashmap.c
+++ b/src/util/test_container_multihashmap.c
@@ -31,7 +31,7 @@
31 if (m != NULL) GNUNET_CONTAINER_multihashmap_destroy (m); \ 31 if (m != NULL) GNUNET_CONTAINER_multihashmap_destroy (m); \
32 if (NULL != \ 32 if (NULL != \
33 iter) \ 33 iter) \
34 GNUNET_CONTAINER_multihashmap_iterator_destroy (iter); \ 34 GNUNET_CONTAINER_multihashmap_iterator_destroy (iter); \
35 return 1; } 35 return 1; }
36#define CHECK(c) { if (! (c)) ABORT (); } 36#define CHECK(c) { if (! (c)) ABORT (); }
37 37
diff --git a/src/util/test_container_multipeermap.c b/src/util/test_container_multipeermap.c
index 9aeead56c..cb6fc30d2 100644
--- a/src/util/test_container_multipeermap.c
+++ b/src/util/test_container_multipeermap.c
@@ -31,7 +31,7 @@
31 if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy (m); \ 31 if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy (m); \
32 if (NULL != \ 32 if (NULL != \
33 iter) \ 33 iter) \
34 GNUNET_CONTAINER_multipeermap_iterator_destroy (iter); \ 34 GNUNET_CONTAINER_multipeermap_iterator_destroy (iter); \
35 return 1; } 35 return 1; }
36#define CHECK(c) { if (! (c)) ABORT (); } 36#define CHECK(c) { if (! (c)) ABORT (); }
37 37
diff --git a/src/util/test_crypto_symmetric.c b/src/util/test_crypto_symmetric.c
index 9f6cd5ed0..5012c7f5b 100644
--- a/src/util/test_crypto_symmetric.c
+++ b/src/util/test_crypto_symmetric.c
@@ -147,7 +147,7 @@ verifyCrypto ()
147 ret = 1; 147 ret = 1;
148 } 148 }
149error: 149error:
150 GNUNET_free_non_null (res); 150 GNUNET_free (res);
151 return ret; 151 return ret;
152} 152}
153 153
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c
index 2bdca5c9d..6d4a131bb 100644
--- a/src/util/test_os_start_process.c
+++ b/src/util/test_os_start_process.c
@@ -138,7 +138,7 @@ run_task (void *cls)
138 } 138 }
139 139
140 proc = 140 proc =
141 GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_ERR, 141 GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR,
142 hello_pipe_stdin, hello_pipe_stdout, NULL, 142 hello_pipe_stdin, hello_pipe_stdout, NULL,
143 fn, 143 fn,
144 "test_gnunet_echo_hello", "-", NULL); 144 "test_gnunet_echo_hello", "-", NULL);
@@ -212,7 +212,8 @@ check_kill ()
212 } 212 }
213 fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); 213 fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
214 proc = 214 proc =
215 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, 215 GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR
216 | GNUNET_OS_USE_PIPE_CONTROL,
216 hello_pipe_stdin, 217 hello_pipe_stdin,
217 hello_pipe_stdout, 218 hello_pipe_stdout,
218 NULL, 219 NULL,
@@ -256,7 +257,8 @@ check_instant_kill ()
256 } 257 }
257 fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); 258 fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
258 proc = 259 proc =
259 GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, 260 GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR
261 | GNUNET_OS_USE_PIPE_CONTROL,
260 hello_pipe_stdin, hello_pipe_stdout, NULL, 262 hello_pipe_stdin, hello_pipe_stdout, NULL,
261 fn, 263 fn,
262 "gnunet-service-resolver", "-", NULL); 264 "gnunet-service-resolver", "-", NULL);
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c
index 13fda53bf..eefb20890 100644
--- a/src/util/test_resolver_api.c
+++ b/src/util/test_resolver_api.c
@@ -215,7 +215,7 @@ run (void *cls, char *const *args, const char *cfgfile,
215 own_fqdn = GNUNET_RESOLVER_local_fqdn_get (); 215 own_fqdn = GNUNET_RESOLVER_local_fqdn_get ();
216 /* can't really check, only thing we can safely 216 /* can't really check, only thing we can safely
217 compare against is our own identical logic... */ 217 compare against is our own identical logic... */
218 GNUNET_free_non_null (own_fqdn); 218 GNUNET_free (own_fqdn);
219 219
220 /* 220 /*
221 * Testing non-local DNS resolution 221 * Testing non-local DNS resolution
@@ -348,8 +348,8 @@ main (int argc, char *argv[])
348 "WARNING", 348 "WARNING",
349 NULL); 349 NULL);
350 fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); 350 fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
351 proc = GNUNET_OS_start_process (GNUNET_YES, 351 proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
352 GNUNET_OS_INHERIT_STD_OUT_AND_ERR, 352 | GNUNET_OS_USE_PIPE_CONTROL,
353 NULL, NULL, NULL, 353 NULL, NULL, NULL,
354 fn, 354 fn,
355 "gnunet-service-resolver", 355 "gnunet-service-resolver",
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c
index 471ca64e5..0e2e7f760 100644
--- a/src/util/test_scheduler.c
+++ b/src/util/test_scheduler.c
@@ -133,7 +133,7 @@ task4 (void *cls)
133 133
134 GNUNET_assert (4 == *ok); 134 GNUNET_assert (4 == *ok);
135 (*ok) = 6; 135 (*ok) = 6;
136 p = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); 136 p = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE);
137 GNUNET_assert (NULL != p); 137 GNUNET_assert (NULL != p);
138 fds[0] = GNUNET_DISK_pipe_handle (p, GNUNET_DISK_PIPE_END_READ); 138 fds[0] = GNUNET_DISK_pipe_handle (p, GNUNET_DISK_PIPE_END_READ);
139 fds[1] = GNUNET_DISK_pipe_handle (p, GNUNET_DISK_PIPE_END_WRITE); 139 fds[1] = GNUNET_DISK_pipe_handle (p, GNUNET_DISK_PIPE_END_WRITE);