diff options
author | Martin Willi <martin@strongswan.org> | 2009-08-13 16:04:45 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-08-26 11:23:50 +0200 |
commit | ddf7c6ac7b74440a28ce791d40094ab665c66472 (patch) | |
tree | c92c6c215c1b332bd4a593bf0803cab35e981bb8 /src | |
parent | 2b7e085deac956660827f23e339eae797a3326ea (diff) | |
download | strongswan-ddf7c6ac7b74440a28ce791d40094ab665c66472.tar.bz2 strongswan-ddf7c6ac7b74440a28ce791d40094ab665c66472.tar.xz |
do not enumerate builders returning NULL
Diffstat (limited to 'src')
-rw-r--r-- | src/libstrongswan/credentials/credential_factory.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libstrongswan/credentials/credential_factory.c b/src/libstrongswan/credentials/credential_factory.c index e50740710..40638119f 100644 --- a/src/libstrongswan/credentials/credential_factory.c +++ b/src/libstrongswan/credentials/credential_factory.c @@ -65,11 +65,17 @@ struct entry_t { */ static bool builder_filter(entry_t *data, entry_t **in, builder_t **out) { + builder_t *builder; + if (data->type == (*in)->type && data->subtype == (*in)->subtype) { - *out = (*in)->constructor(data->subtype); - return TRUE; + builder = (*in)->constructor(data->subtype); + if (builder) + { + *out = builder; + return TRUE; + } } return FALSE; } |