summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-03-09 13:54:36 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-03-09 08:24:52 -0500
commitea155efa0408f84171d28c1f733ea08888dfbe51 (patch)
treebfdec471c3b37e31822fd7a6913f0bc1e23c7c81
parentd10350e1854cd2156567f058f5a76041994e7f2b (diff)
downloadsssd-ea155efa0408f84171d28c1f733ea08888dfbe51.tar.gz
sssd-ea155efa0408f84171d28c1f733ea08888dfbe51.tar.bz2
sssd-ea155efa0408f84171d28c1f733ea08888dfbe51.zip
Two memory leaks in sss_sudo_get_values
https://fedorahosted.org/sssd/ticket/1235
-rw-r--r--src/sss_client/sudo/sss_sudo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sss_client/sudo/sss_sudo.c b/src/sss_client/sudo/sss_sudo.c
index 32c405f3..cb3c746a 100644
--- a/src/sss_client/sudo/sss_sudo.c
+++ b/src/sss_client/sudo/sss_sudo.c
@@ -145,15 +145,18 @@ int sss_sudo_get_values(struct sss_sudo_rule *e,
for (j = 0; j < attr->num_values; j++) {
values[j] = strdup(attr->values[j]);
if (values[j] == NULL) {
+ sss_sudo_free_values(values);
return ENOMEM;
}
}
values[attr->num_values] = NULL;
+
+ break;
}
}
- if (values == 0) {
+ if (values == NULL) {
return ENOENT;
}