summaryrefslogtreecommitdiff
path: root/p11-kit
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-02-06 14:54:53 +0100
committerStef Walter <stefw@gnome.org>2013-02-06 14:54:53 +0100
commit2e8ce8c5ecb6d1f1c8f0af244d9f9b75dc6050ea (patch)
treed2845092b66331b9bdc54dd619bb6291fb4cea75 /p11-kit
parent0c6517104d1306228c31e596b0df6a4fb5af4dd1 (diff)
Fix various clang analyzer warnings
* Add annotations to our precondition functions so that they don't make the analyzer complain
Diffstat (limited to 'p11-kit')
-rw-r--r--p11-kit/conf.c2
-rw-r--r--p11-kit/pin.c3
-rw-r--r--p11-kit/uri.c1
3 files changed, 3 insertions, 3 deletions
diff --git a/p11-kit/conf.c b/p11-kit/conf.c
index 0f98636..28008aa 100644
--- a/p11-kit/conf.c
+++ b/p11-kit/conf.c
@@ -169,6 +169,7 @@ read_config_file (const char* filename, int flags)
if (fread (config, 1, len, f) != len) {
error = errno;
p11_message ("couldn't read config file: %s", filename);
+ free (config);
errno = error;
return NULL;
}
@@ -559,7 +560,6 @@ load_configs_from_directory (const char *directory,
path = strconcat (directory, "/", dp->d_name, NULL);
return_val_if_fail (path != NULL, false);
- is_dir = false;
#ifdef HAVE_STRUCT_DIRENT_D_TYPE
if(dp->d_type != DT_UNKNOWN) {
is_dir = (dp->d_type == DT_DIR);
diff --git a/p11-kit/pin.c b/p11-kit/pin.c
index bb65e4c..afcb8ca 100644
--- a/p11-kit/pin.c
+++ b/p11-kit/pin.c
@@ -194,11 +194,13 @@ register_callback_unlocked (const char *pin_source,
return_val_if_fail (callbacks != NULL, false);
if (!p11_dict_set (gl.pin_sources, name, callbacks))
return_val_if_reached (false);
+ name = NULL;
}
if (!p11_array_push (callbacks, cb))
return_val_if_reached (false);
+ free (name);
return true;
}
@@ -491,7 +493,6 @@ p11_kit_pin_file_callback (const char *pin_source,
if (errno == EAGAIN)
continue;
error = errno;
- error = errno;
break;
} else if (res == 0) {
break;
diff --git a/p11-kit/uri.c b/p11-kit/uri.c
index 826c2c4..e8cb4c8 100644
--- a/p11-kit/uri.c
+++ b/p11-kit/uri.c
@@ -1236,7 +1236,6 @@ p11_kit_uri_parse (const char *string, P11KitUriType uri_type,
return P11_KIT_URI_BAD_SCHEME;
string = epos + 1;
- ret = -1;
/* Clear everything out */
memset (&uri->module, 0, sizeof (uri->module));