diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2023-02-06 15:03:33 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2023-02-06 15:03:33 +0900 |
commit | eabc1baaf980d8948f3fc0ac83a84446d5f1b226 (patch) | |
tree | 0b556db9bd861324844783fafbb4bc652c6e65e8 | |
parent | ab66a7a9dfe818d884caf555293370c730eccc57 (diff) | |
download | gnunet-eabc1baaf980d8948f3fc0ac83a84446d5f1b226.tar.gz gnunet-eabc1baaf980d8948f3fc0ac83a84446d5f1b226.zip |
DHT: Fix warnings when freeing allocated strings from GNUNET_STRINGS_get_utf8_args
A modification of ulfvonbelow's patch in #7651 that also silences
warnings.
-rw-r--r-- | src/dht/gnunet-dht-get.c | 4 | ||||
-rw-r--r-- | src/dht/gnunet-dht-put.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c index 1ae9235f8..02f04de26 100644 --- a/src/dht/gnunet-dht-get.c +++ b/src/dht/gnunet-dht-get.c | |||
@@ -284,6 +284,7 @@ run (void *cls, | |||
284 | int | 284 | int |
285 | main (int argc, char *const *argv) | 285 | main (int argc, char *const *argv) |
286 | { | 286 | { |
287 | char *u8_argv = NULL; | ||
287 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 288 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
288 | GNUNET_GETOPT_option_string ( | 289 | GNUNET_GETOPT_option_string ( |
289 | 'k', | 290 | 'k', |
@@ -341,6 +342,9 @@ main (int argc, char *const *argv) | |||
341 | NULL)) | 342 | NULL)) |
342 | ? ret | 343 | ? ret |
343 | : 1; | 344 | : 1; |
345 | // This is ugly, but meh. The GNUNET_STRINGS_get_utf8_args allows us to do this. | ||
346 | u8_argv = (char*) argv; | ||
347 | GNUNET_free (u8_argv); | ||
344 | } | 348 | } |
345 | 349 | ||
346 | 350 | ||
diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c index 531107ef2..37e7911b5 100644 --- a/src/dht/gnunet-dht-put.c +++ b/src/dht/gnunet-dht-put.c | |||
@@ -179,6 +179,7 @@ run (void *cls, | |||
179 | int | 179 | int |
180 | main (int argc, char *const *argv) | 180 | main (int argc, char *const *argv) |
181 | { | 181 | { |
182 | char *u8_argv = NULL; | ||
182 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 183 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
183 | GNUNET_GETOPT_option_string ( | 184 | GNUNET_GETOPT_option_string ( |
184 | 'd', | 185 | 'd', |
@@ -244,6 +245,9 @@ main (int argc, char *const *argv) | |||
244 | NULL)) | 245 | NULL)) |
245 | ? ret | 246 | ? ret |
246 | : 1; | 247 | : 1; |
248 | // This is ugly, but meh. The GNUNET_STRINGS_get_utf8_args allows us to do this. | ||
249 | u8_argv = (char*) argv; | ||
250 | GNUNET_free (u8_argv); | ||
247 | } | 251 | } |
248 | 252 | ||
249 | 253 | ||