summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd
diff options
context:
space:
mode:
Diffstat (limited to 'ldap/servers/slapd')
-rw-r--r--ldap/servers/slapd/tools/ldclt/scalab01.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/ldap/servers/slapd/tools/ldclt/scalab01.c b/ldap/servers/slapd/tools/ldclt/scalab01.c
index c0437b08..39345bd1 100644
--- a/ldap/servers/slapd/tools/ldclt/scalab01.c
+++ b/ldap/servers/slapd/tools/ldclt/scalab01.c
@@ -465,6 +465,13 @@ scalab01_addLogin (
else
{
cur = s1ctx.list;
+
+ /* If cur is NULL, we should just bail and free new. */
+ if (cur == NULL)
+ {
+ goto error;
+ }
+
while (cur != NULL)
{
if (cur->next == NULL)
@@ -472,15 +479,16 @@ scalab01_addLogin (
cur->next = new;
cur = NULL; /* Exit loop */
}
- else
- if (cur->next->counter >= duration)
- {
+ else if (cur->next->counter >= duration)
+ {
new->next = cur->next;
cur->next = new;
cur = NULL; /* Exit loop */
- }
- else
+ }
+ else
+ {
cur = cur->next;
+ }
}
}
}