From 10db3ef21eef1c7a1727579952a81ced2f4afc8b Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Sat, 11 May 2019 21:42:48 +0200 Subject: lib: reduce variable scopes Fixes Codacy/CppCheck warnings. Closes https://github.com/curl/curl/pull/3872 --- lib/ldap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/ldap.c') diff --git a/lib/ldap.c b/lib/ldap.c index 79dc2f2ed..fd31faa3e 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -1069,8 +1069,6 @@ static int _ldap_url_parse(const struct connectdata *conn, static void _ldap_free_urldesc(LDAPURLDesc *ludp) { - size_t i; - if(!ludp) return; @@ -1078,6 +1076,7 @@ static void _ldap_free_urldesc(LDAPURLDesc *ludp) free(ludp->lud_filter); if(ludp->lud_attrs) { + size_t i; for(i = 0; i < ludp->lud_attrs_dups; i++) free(ludp->lud_attrs[i]); free(ludp->lud_attrs); -- cgit v1.2.3