diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-12-09 13:24:44 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-12-09 13:24:44 +0000 |
commit | e61d9ea0a63b7a13ac02cfdd332cdaa5ee0ef1ad (patch) | |
tree | 40264d626cdfe9f2e793e179ce7ed90e07fa5c38 | |
parent | 98011e85405f9e98899cff69a020979e33a06f0d (diff) | |
download | mailutils-e61d9ea0a63b7a13ac02cfdd332cdaa5ee0ef1ad.tar.gz mailutils-e61d9ea0a63b7a13ac02cfdd332cdaa5ee0ef1ad.tar.bz2 |
(_get_address_part): Bugfix: assign to *data only if ret is not null.
-rw-r--r-- | libsieve/tests.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libsieve/tests.c b/libsieve/tests.c index e07535a67..91ae28ae2 100644 --- a/libsieve/tests.c +++ b/libsieve/tests.c @@ -31,7 +31,7 @@ static int _get_address_part (void *item, void *data) { sieve_runtime_tag_t *t = item; - address_aget_t ret; + address_aget_t ret = NULL; if (strcmp (t->tag, "all") == 0) ret = address_aget_email; @@ -39,8 +39,12 @@ _get_address_part (void *item, void *data) ret = address_aget_domain; else if (strcmp (t->tag, "localpart") == 0) ret = address_aget_local_part; - *(address_aget_t*)data = ret; - return ret != NULL; + if (ret) + { + *(address_aget_t*)data = ret; + return 1; /* break the loop */ + } + return 0; /* continue */ } address_aget_t |