summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-21 00:54:49 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-21 00:54:49 +0200
commit30361fe0e89a72e2dd248a93824b06d858e4e81a (patch)
tree5cd5b9917bf1fb6899587683ab1680472c29194a /src/util
parent172d6b0c471cd6512b8074d78f59ae9bb8cad9e7 (diff)
make GNUNET_freez default, have GNUNET_free_nz for cases where that does not work
Diffstat (limited to 'src/util')
-rw-r--r--src/util/gnunet-config.c2
-rw-r--r--src/util/gnunet-ecc.c2
-rw-r--r--src/util/gnunet-resolver.c12
-rw-r--r--src/util/gnunet-scrypt.c2
-rw-r--r--src/util/gnunet-uri.c2
-rw-r--r--src/util/scheduler.c10
6 files changed, 16 insertions, 14 deletions
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c
index f101e8b61..5883c1497 100644
--- a/src/util/gnunet-config.c
+++ b/src/util/gnunet-config.c
@@ -331,7 +331,7 @@ main (int argc, char *const *argv)
options,
&run,
NULL);
- GNUNET_free ((void *) argv);
+ GNUNET_free_nz ((void *) argv);
if (GNUNET_OK == ret)
return global_ret;
return ret;
diff --git a/src/util/gnunet-ecc.c b/src/util/gnunet-ecc.c
index 764a507b6..8e30ac416 100644
--- a/src/util/gnunet-ecc.c
+++ b/src/util/gnunet-ecc.c
@@ -501,7 +501,7 @@ main (int argc, char *const *argv)
NULL))
? 0
: 1;
- GNUNET_free ((void *) argv);
+ GNUNET_free_nz ((void *) argv);
return ret;
}
diff --git a/src/util/gnunet-resolver.c b/src/util/gnunet-resolver.c
index 6a602c64e..8a6c7fbe9 100644
--- a/src/util/gnunet-resolver.c
+++ b/src/util/gnunet-resolver.c
@@ -171,14 +171,18 @@ main (int argc, char *const *argv)
};
int ret;
- if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
+ if (GNUNET_OK !=
+ GNUNET_STRINGS_get_utf8_args (argc, argv,
+ &argc, &argv))
return 2;
ret = (GNUNET_OK ==
- GNUNET_PROGRAM_run (argc, argv, "gnunet-resolver [hostname]",
+ GNUNET_PROGRAM_run (argc, argv,
+ "gnunet-resolver [hostname]",
gettext_noop ("Use build-in GNUnet stub resolver"),
- options, &run, NULL)) ? 0 : 1;
- GNUNET_free ((void *) argv);
+ options,
+ &run, NULL)) ? 0 : 1;
+ GNUNET_free_nz ((void *) argv);
return ret;
}
diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c
index 8c46136b9..70ba48d82 100644
--- a/src/util/gnunet-scrypt.c
+++ b/src/util/gnunet-scrypt.c
@@ -322,7 +322,7 @@ main (int argc, char *const *argv)
NULL))
? 0
: 1;
- GNUNET_free ((void *) argv);
+ GNUNET_free_nz ((void *) argv);
GNUNET_free_non_null (pwfn);
return ret;
}
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c
index 84100ff56..48c46ee49 100644
--- a/src/util/gnunet-uri.c
+++ b/src/util/gnunet-uri.c
@@ -184,7 +184,7 @@ main (int argc, char *const *argv)
shc_chld = NULL;
GNUNET_DISK_pipe_close (sigpipe);
sigpipe = NULL;
- GNUNET_free ((void *) argv);
+ GNUNET_free_nz ((void *) argv);
return ((GNUNET_OK == ret) && (0 == exit_code)) ? 0 : 1;
}
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 45a6b61e5..93393bd7c 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -584,28 +584,26 @@ dump_backtrace (struct GNUNET_SCHEDULER_Task *t)
static void
destroy_task (struct GNUNET_SCHEDULER_Task *t)
{
- unsigned int i;
-
LOG (GNUNET_ERROR_TYPE_DEBUG,
"destroying task %p\n",
t);
if (GNUNET_YES == t->own_handles)
{
- for (i = 0; i != t->fds_len; ++i)
+ for (unsigned int i = 0; i != t->fds_len; ++i)
{
const struct GNUNET_NETWORK_Handle *fd = t->fds[i].fd;
const struct GNUNET_DISK_FileHandle *fh = t->fds[i].fh;
if (fd)
{
- GNUNET_NETWORK_socket_free_memory_only_ ((struct
- GNUNET_NETWORK_Handle *) fd);
+ GNUNET_NETWORK_socket_free_memory_only_ (
+ (struct GNUNET_NETWORK_Handle *) fd);
}
if (fh)
{
// FIXME: on WIN32 this is not enough! A function
// GNUNET_DISK_file_free_memory_only would be nice
- GNUNET_free ((void *) fh);
+ GNUNET_free_nz ((void *) fh);
}
}
}