aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/client.c1
-rw-r--r--src/util/configuration.c1
-rw-r--r--src/util/crypto_hkdf.c6
-rw-r--r--src/util/disk.c1
-rw-r--r--src/util/network.c2
-rw-r--r--src/util/os_priority.c10
-rw-r--r--src/util/strings.c2
7 files changed, 15 insertions, 8 deletions
diff --git a/src/util/client.c b/src/util/client.c
index afd2fe900..4e5eca32a 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -745,6 +745,7 @@ test_service_configuration (const char *service_name,
745 service_name, 745 service_name,
746 "UNIXPATH", 746 "UNIXPATH",
747 _ ("not a valid filename")); 747 _ ("not a valid filename"));
748 GNUNET_free (unixpath);
748 return GNUNET_SYSERR; /* UNIXPATH specified but invalid! */ 749 return GNUNET_SYSERR; /* UNIXPATH specified but invalid! */
749 } 750 }
750 GNUNET_free (unixpath); 751 GNUNET_free (unixpath);
diff --git a/src/util/configuration.c b/src/util/configuration.c
index dff3c2e99..1aa52ad76 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -1007,6 +1007,7 @@ GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
1007 cf->source_filename, 1007 cf->source_filename,
1008 parent->source_filename, 1008 parent->source_filename,
1009 filename); 1009 filename);
1010 GNUNET_free (fn);
1010 return GNUNET_SYSERR; 1011 return GNUNET_SYSERR;
1011 } 1012 }
1012 } 1013 }
diff --git a/src/util/crypto_hkdf.c b/src/util/crypto_hkdf.c
index 86a814b12..7270b87b6 100644
--- a/src/util/crypto_hkdf.c
+++ b/src/util/crypto_hkdf.c
@@ -77,7 +77,11 @@ static const void *
77doHMAC (gcry_md_hd_t mac, const void *key, size_t key_len, const void *buf, 77doHMAC (gcry_md_hd_t mac, const void *key, size_t key_len, const void *buf,
78 size_t buf_len) 78 size_t buf_len)
79{ 79{
80 gcry_md_setkey (mac, key, key_len); 80 if (GPG_ERR_NO_ERROR != gcry_md_setkey (mac, key, key_len))
81 {
82 GNUNET_break (0);
83 return NULL;
84 }
81 gcry_md_write (mac, buf, buf_len); 85 gcry_md_write (mac, buf, buf_len);
82 86
83 return (const void *) gcry_md_read (mac, 0); 87 return (const void *) gcry_md_read (mac, 0);
diff --git a/src/util/disk.c b/src/util/disk.c
index ada35249f..2efb52d46 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1020,6 +1020,7 @@ GNUNET_DISK_glob (const char *glob_pattern,
1020 LOG (GNUNET_ERROR_TYPE_ERROR, 1020 LOG (GNUNET_ERROR_TYPE_ERROR,
1021 "unsupported glob pattern: '%s'\n", 1021 "unsupported glob pattern: '%s'\n",
1022 glob_pattern); 1022 glob_pattern);
1023 GNUNET_free (mypat);
1023 return -1; 1024 return -1;
1024 } 1025 }
1025 1026
diff --git a/src/util/network.c b/src/util/network.c
index e771a9834..61da37ab7 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -122,7 +122,7 @@ GNUNET_NETWORK_test_pf (int pf)
122 } 122 }
123 else 123 else
124 { 124 {
125 close (s); 125 GNUNET_break (0 == close (s));
126 ret = GNUNET_OK; 126 ret = GNUNET_OK;
127 } 127 }
128 switch (pf) 128 switch (pf)
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index 1ed9bcbf7..dc2f0f97e 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -316,7 +316,7 @@ open_dev_null (int target_fd, int flags)
316 if (-1 == dup2 (fd, target_fd)) 316 if (-1 == dup2 (fd, target_fd))
317 { 317 {
318 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "dup2"); 318 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "dup2");
319 (void) close (fd); 319 GNUNET_break (0 == close (fd));
320 return; 320 return;
321 } 321 }
322 GNUNET_break (0 == close (fd)); 322 GNUNET_break (0 == close (fd));
@@ -395,7 +395,7 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
395 if (NULL != childpipe_write) 395 if (NULL != childpipe_write)
396 GNUNET_DISK_file_close (childpipe_write); 396 GNUNET_DISK_file_close (childpipe_write);
397 if (0 <= dup_childpipe_read_fd) 397 if (0 <= dup_childpipe_read_fd)
398 close (dup_childpipe_read_fd); 398 GNUNET_break (0 == close (dup_childpipe_read_fd));
399 return NULL; 399 return NULL;
400 } 400 }
401 childpipe_read_fd = dup_childpipe_read_fd; 401 childpipe_read_fd = dup_childpipe_read_fd;
@@ -474,7 +474,7 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
474 if (NULL != childpipe_write) 474 if (NULL != childpipe_write)
475 GNUNET_DISK_file_close (childpipe_write); 475 GNUNET_DISK_file_close (childpipe_write);
476 if (0 <= childpipe_read_fd) 476 if (0 <= childpipe_read_fd)
477 close (childpipe_read_fd); 477 GNUNET_break (0 == close (childpipe_read_fd));
478 errno = eno; 478 errno = eno;
479 return NULL; 479 return NULL;
480 } 480 }
@@ -486,7 +486,7 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
486 gnunet_proc->control_pipe = childpipe_write; 486 gnunet_proc->control_pipe = childpipe_write;
487 if (0 != (std_inheritance & GNUNET_OS_USE_PIPE_CONTROL)) 487 if (0 != (std_inheritance & GNUNET_OS_USE_PIPE_CONTROL))
488 { 488 {
489 close (childpipe_read_fd); 489 GNUNET_break (0 == close (childpipe_read_fd));
490 } 490 }
491 GNUNET_array_grow (lscp, ls, 0); 491 GNUNET_array_grow (lscp, ls, 0);
492 return gnunet_proc; 492 return gnunet_proc;
@@ -564,7 +564,7 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
564 { 564 {
565 /* Bury any existing FD, no matter what; they should all be closed 565 /* Bury any existing FD, no matter what; they should all be closed
566 * on exec anyway and the important ones have been dup'ed away */ 566 * on exec anyway and the important ones have been dup'ed away */
567 (void) close (tgt); 567 GNUNET_break (0 == close (tgt));
568 GNUNET_assert (-1 != dup2 (lscp[i], tgt)); 568 GNUNET_assert (-1 != dup2 (lscp[i], tgt));
569 } 569 }
570 /* unset close-on-exec flag */ 570 /* unset close-on-exec flag */
diff --git a/src/util/strings.c b/src/util/strings.c
index 24335e444..673915888 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -1600,7 +1600,7 @@ GNUNET_STRINGS_base64_encode (const void *in,
1600 char *opt; 1600 char *opt;
1601 1601
1602 ret = 0; 1602 ret = 0;
1603 GNUNET_assert (len / 4 < SIZE_MAX); 1603 GNUNET_assert (len < SIZE_MAX / 4 * 3 );
1604 opt = GNUNET_malloc (2 + (len * 4 / 3) + 8); 1604 opt = GNUNET_malloc (2 + (len * 4 / 3) + 8);
1605 for (size_t i = 0; i < len; ++i) 1605 for (size_t i = 0; i < len; ++i)
1606 { 1606 {