From e40d562b7996e6224390fed957b9dc8f313996f2 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 12 Jun 2012 09:36:48 +0000 Subject: [PATCH] - fix mem leak --- src/transport/gnunet-transport.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 6bc7a2086..1b4e7e384 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c @@ -670,6 +670,7 @@ run (void *cls, char *const *args, const char *cfgfile, int main (int argc, char *const *argv) { + int res; static const struct GNUNET_GETOPT_CommandLineOption options[] = { {'b', "benchmark", NULL, gettext_noop ("measure how fast we are receiving data (until CTRL-C)"), @@ -700,11 +701,18 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-transport", + res = GNUNET_PROGRAM_run (argc, argv, "gnunet-transport", gettext_noop ("Direct access to transport service."), options, - &run, NULL)) ? ret : 1; + &run, NULL); + GNUNET_free ((void *) argv); + + if (GNUNET_OK == res) + return ret; + else + return 1; + + } -- 2.25.1