From: Arran Cudbard-Bell Date: Tue, 7 Jul 2015 21:44:14 +0000 (-0400) Subject: Fix leak that wasn't really a leak Closes #1122 X-Git-Tag: release_3_0_9~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6dc520433d316e2eeb8febcd32234aab7017410b;p=thirdparty%2Ffreeradius-server.git Fix leak that wasn't really a leak Closes #1122 The server would immediately exit anyway, but for code cleanliness we should probably fix it. As reported by jpereira. --- diff --git a/src/modules/rlm_ldap/clients.c b/src/modules/rlm_ldap/clients.c index 5b9d88273c2..8654475cdce 100644 --- a/src/modules/rlm_ldap/clients.c +++ b/src/modules/rlm_ldap/clients.c @@ -127,10 +127,16 @@ int rlm_ldap_client_load(rlm_ldap_t const *inst, CONF_SECTION *tmpl, CONF_SECTIO * Create an array of LDAP attributes to feed to rlm_ldap_search. */ attrs = talloc_array(inst, char const *, count); - if (rlm_ldap_client_get_attrs(attrs, &idx, map) < 0) return -1; + if (rlm_ldap_client_get_attrs(attrs, &idx, map) < 0) { + talloc_free(attrs); + return -1; + } conn = mod_conn_get(inst, NULL); - if (!conn) return -1; + if (!conn) { + talloc_free(attrs); + return -1; + } /* * Perform all searches as the admin user.