summaryrefslogtreecommitdiff
path: root/lib/ldap.c
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-11 21:42:48 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-20 08:51:11 +0200
commit10db3ef21eef1c7a1727579952a81ced2f4afc8b (patch)
tree57129a847b5913959063a60290201b1f52482fee /lib/ldap.c
parent27af2ec219244bef24e6d11649d41aad3668da45 (diff)
downloadcurl-10db3ef21eef1c7a1727579952a81ced2f4afc8b.tar.gz
lib: reduce variable scopes
Fixes Codacy/CppCheck warnings. Closes https://github.com/curl/curl/pull/3872
Diffstat (limited to 'lib/ldap.c')
-rw-r--r--lib/ldap.c3
1 files changed, 1 insertions, 2 deletions
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);