diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2017-10-10 16:01:14 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2017-10-10 16:01:14 +0200 |
commit | 1cfa320f0cb213aed0a3a04577d065a65f847d49 (patch) | |
tree | caf0db997af48e9599c964cfccc9953ed0baca24 /src/identity-provider/gnunet-idp.c | |
parent | df344790f7f2e7c39cfd951ce373c4ec52b6cda7 (diff) | |
download | gnunet-1cfa320f0cb213aed0a3a04577d065a65f847d49.tar.gz gnunet-1cfa320f0cb213aed0a3a04577d065a65f847d49.zip |
-bugfixes, fix memleaks
Diffstat (limited to 'src/identity-provider/gnunet-idp.c')
-rw-r--r-- | src/identity-provider/gnunet-idp.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/identity-provider/gnunet-idp.c b/src/identity-provider/gnunet-idp.c index 6940220d7..0efe6eaa9 100644 --- a/src/identity-provider/gnunet-idp.c +++ b/src/identity-provider/gnunet-idp.c | |||
@@ -32,6 +32,11 @@ | |||
32 | #include "gnunet_signatures.h" | 32 | #include "gnunet_signatures.h" |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * return value | ||
36 | */ | ||
37 | static int ret; | ||
38 | |||
39 | /** | ||
35 | * List attribute flag | 40 | * List attribute flag |
36 | */ | 41 | */ |
37 | static int list; | 42 | static int list; |
@@ -154,10 +159,6 @@ store_attr_cont (void *cls, | |||
154 | if (GNUNET_SYSERR == success) { | 159 | if (GNUNET_SYSERR == success) { |
155 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 160 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
156 | "%s\n", emsg); | 161 | "%s\n", emsg); |
157 | } else { | ||
158 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | ||
159 | "Successfully added identity attribute %s=%s\n", | ||
160 | attr_name, attr_value); | ||
161 | } | 162 | } |
162 | GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); | 163 | GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); |
163 | } | 164 | } |
@@ -172,6 +173,11 @@ process_attrs (void *cls, | |||
172 | GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); | 173 | GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); |
173 | return; | 174 | return; |
174 | } | 175 | } |
176 | if (NULL == attr) | ||
177 | { | ||
178 | ret = 1; | ||
179 | return; | ||
180 | } | ||
175 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | 181 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, |
176 | "%s: %s\n", attr->name, (char*)attr->data); | 182 | "%s: %s\n", attr->name, (char*)attr->data); |
177 | } | 183 | } |
@@ -190,11 +196,11 @@ static void | |||
190 | process_rvk (void *cls, int success, const char* msg) | 196 | process_rvk (void *cls, int success, const char* msg) |
191 | { | 197 | { |
192 | if (GNUNET_OK != success) | 198 | if (GNUNET_OK != success) |
199 | { | ||
193 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | 200 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, |
194 | "Revocation failed.\n"); | 201 | "Revocation failed.\n"); |
195 | else | 202 | ret = 1; |
196 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | 203 | } |
197 | "Revocation successful.\n"); | ||
198 | GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); | 204 | GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); |
199 | } | 205 | } |
200 | 206 | ||
@@ -335,7 +341,7 @@ run (void *cls, | |||
335 | const char *cfgfile, | 341 | const char *cfgfile, |
336 | const struct GNUNET_CONFIGURATION_Handle *c) | 342 | const struct GNUNET_CONFIGURATION_Handle *c) |
337 | { | 343 | { |
338 | 344 | ret = 0; | |
339 | if (NULL == ego_name) | 345 | if (NULL == ego_name) |
340 | { | 346 | { |
341 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, | 347 | GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE, |
@@ -400,7 +406,8 @@ main(int argc, char *const argv[]) | |||
400 | &revoke_ticket), | 406 | &revoke_ticket), |
401 | GNUNET_GETOPT_OPTION_END | 407 | GNUNET_GETOPT_OPTION_END |
402 | }; | 408 | }; |
403 | return GNUNET_PROGRAM_run (argc, argv, "ct", | 409 | GNUNET_PROGRAM_run (argc, argv, "ct", |
404 | "ct", options, | 410 | "ct", options, |
405 | &run, NULL); | 411 | &run, NULL); |
412 | return ret; | ||
406 | } | 413 | } |