diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2012-09-17 09:06:59 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2012-09-17 09:06:59 +0000 |
commit | 9dd20836aba6af69923cd88d2fb6a6c2c07a1ab5 (patch) | |
tree | 544b221eed0953cd455b8e11147d1a18f28c80bb /src/util/helper.c | |
parent | 2bd330db5edb23508e99d4a22a7f1c81754625ac (diff) | |
download | gnunet-9dd20836aba6af69923cd88d2fb6a6c2c07a1ab5.tar.gz gnunet-9dd20836aba6af69923cd88d2fb6a6c2c07a1ab5.zip |
fix for "bad address " issue with wlan helper
Diffstat (limited to 'src/util/helper.c')
-rw-r--r-- | src/util/helper.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/util/helper.c b/src/util/helper.c index 9faf2ee50..1d3edb4d2 100644 --- a/src/util/helper.c +++ b/src/util/helper.c | |||
@@ -136,7 +136,7 @@ struct GNUNET_HELPER_Handle | |||
136 | /** | 136 | /** |
137 | * NULL-terminated list of command-line arguments. | 137 | * NULL-terminated list of command-line arguments. |
138 | */ | 138 | */ |
139 | char *const *binary_argv; | 139 | char **binary_argv; |
140 | 140 | ||
141 | /** | 141 | /** |
142 | * Task to read from the helper. | 142 | * Task to read from the helper. |
@@ -411,11 +411,18 @@ GNUNET_HELPER_start (int with_control_pipe, | |||
411 | void *cb_cls) | 411 | void *cb_cls) |
412 | { | 412 | { |
413 | struct GNUNET_HELPER_Handle*h; | 413 | struct GNUNET_HELPER_Handle*h; |
414 | 414 | int c = 0; | |
415 | h = GNUNET_malloc (sizeof (struct GNUNET_HELPER_Handle)); | 415 | h = GNUNET_malloc (sizeof (struct GNUNET_HELPER_Handle)); |
416 | h->with_control_pipe = with_control_pipe; | 416 | h->with_control_pipe = with_control_pipe; |
417 | h->binary_name = binary_name; | 417 | h->binary_name = GNUNET_strdup (binary_name); |
418 | h->binary_argv = binary_argv; | 418 | |
419 | for (c = 0; binary_argv[c] != NULL; c++) | ||
420 | c ++; | ||
421 | h->binary_argv = GNUNET_malloc (sizeof (char *[c + 1])); | ||
422 | for (c = 0; binary_argv[c] != NULL; c++) | ||
423 | h->binary_argv[c] = GNUNET_strdup (binary_argv[c]); | ||
424 | h->binary_argv[c] = NULL; | ||
425 | |||
419 | h->cb_cls = cb_cls; | 426 | h->cb_cls = cb_cls; |
420 | h->mst = GNUNET_SERVER_mst_create (cb, h->cb_cls); | 427 | h->mst = GNUNET_SERVER_mst_create (cb, h->cb_cls); |
421 | h->exp_cb = exp_cb; | 428 | h->exp_cb = exp_cb; |
@@ -433,7 +440,7 @@ void | |||
433 | GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h) | 440 | GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h) |
434 | { | 441 | { |
435 | struct GNUNET_HELPER_SendHandle *sh; | 442 | struct GNUNET_HELPER_SendHandle *sh; |
436 | 443 | int c; | |
437 | h->exp_cb = NULL; | 444 | h->exp_cb = NULL; |
438 | /* signal pending writes that we were stopped */ | 445 | /* signal pending writes that we were stopped */ |
439 | while (NULL != (sh = h->sh_head)) | 446 | while (NULL != (sh = h->sh_head)) |
@@ -447,6 +454,10 @@ GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h) | |||
447 | } | 454 | } |
448 | stop_helper (h); | 455 | stop_helper (h); |
449 | GNUNET_SERVER_mst_destroy (h->mst); | 456 | GNUNET_SERVER_mst_destroy (h->mst); |
457 | GNUNET_free ((char *) h->binary_name); | ||
458 | for (c = 0; h->binary_argv[c] != NULL; c++) | ||
459 | GNUNET_free (h->binary_argv[c]); | ||
460 | GNUNET_free (h->binary_argv); | ||
450 | GNUNET_free (h); | 461 | GNUNET_free (h); |
451 | } | 462 | } |
452 | 463 | ||