Tony Asleson
2014-10-09 00:34:58 UTC
Not likely to happen in normal operation.
Signed-off-by: Tony Asleson <***@redhat.com>
---
daemon/lsm_daemon.c | 6 +++++-
plugin/simc/simc_lsmplugin.c | 3 +++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/daemon/lsm_daemon.c b/daemon/lsm_daemon.c
index 80e0064..ef958f1 100644
--- a/daemon/lsm_daemon.c
+++ b/daemon/lsm_daemon.c
@@ -367,7 +367,7 @@ int setup_socket(char *full_name)
} else {
err = errno;
- loud("Error on unlinking file %s: %s\n",
+ loud("Error on socket create %s: %s\n",
socket_file, strerror(err));
}
@@ -425,6 +425,10 @@ int process_plugin(void *p, char *full_name)
LIST_INSERT_HEAD((struct plugin_list*)p, item, pointers);
info("Plugin %s added\n", full_name);
} else {
+ /* The only real way to get here is failed strdup as
+ setup_socket will exit on error. */
+ free(item);
+ item = NULL;
loud("strdup failed %s\n", full_name);
}
} else {
diff --git a/plugin/simc/simc_lsmplugin.c b/plugin/simc/simc_lsmplugin.c
index 5ef2afd..8e08be6 100644
--- a/plugin/simc/simc_lsmplugin.c
+++ b/plugin/simc/simc_lsmplugin.c
@@ -2184,6 +2184,9 @@ int load( lsm_plugin_ptr c, const char *uri, const char *password,
lsm_disk_record_free(d);
d = NULL;
+ free(key);
+ key = NULL;
+
break;
}
Signed-off-by: Tony Asleson <***@redhat.com>
---
daemon/lsm_daemon.c | 6 +++++-
plugin/simc/simc_lsmplugin.c | 3 +++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/daemon/lsm_daemon.c b/daemon/lsm_daemon.c
index 80e0064..ef958f1 100644
--- a/daemon/lsm_daemon.c
+++ b/daemon/lsm_daemon.c
@@ -367,7 +367,7 @@ int setup_socket(char *full_name)
} else {
err = errno;
- loud("Error on unlinking file %s: %s\n",
+ loud("Error on socket create %s: %s\n",
socket_file, strerror(err));
}
@@ -425,6 +425,10 @@ int process_plugin(void *p, char *full_name)
LIST_INSERT_HEAD((struct plugin_list*)p, item, pointers);
info("Plugin %s added\n", full_name);
} else {
+ /* The only real way to get here is failed strdup as
+ setup_socket will exit on error. */
+ free(item);
+ item = NULL;
loud("strdup failed %s\n", full_name);
}
} else {
diff --git a/plugin/simc/simc_lsmplugin.c b/plugin/simc/simc_lsmplugin.c
index 5ef2afd..8e08be6 100644
--- a/plugin/simc/simc_lsmplugin.c
+++ b/plugin/simc/simc_lsmplugin.c
@@ -2184,6 +2184,9 @@ int load( lsm_plugin_ptr c, const char *uri, const char *password,
lsm_disk_record_free(d);
d = NULL;
+ free(key);
+ key = NULL;
+
break;
}
--
1.8.2.1
1.8.2.1