From ea155efa0408f84171d28c1f733ea08888dfbe51 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Fri, 9 Mar 2012 13:54:36 +0100 Subject: Two memory leaks in sss_sudo_get_values https://fedorahosted.org/sssd/ticket/1235 --- src/sss_client/sudo/sss_sudo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit