}
}
}
- if (result)
- ldap_msgfree(result);
+ ldap_msgfree(result);
/* Check for nested netgroups in what we added. */
start = old_tail ? STAILQ_NEXT(old_tail, entries) : STAILQ_FIRST(netgroups);
debug_return_bool(true);
oom:
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
- if (result)
- ldap_msgfree(result);
+ ldap_msgfree(result);
debug_return_bool(false);
overflow:
sudo_warnx(U_("internal error, %s overflow"), __func__);
free(filt);
if (rc != LDAP_SUCCESS) {
DPRINTF1("ldap netgroup search failed: %s", ldap_err2string(rc));
- if (result)
- ldap_msgfree(result);
+ ldap_msgfree(result);
continue;
}
ldap_value_free_len(bv);
}
}
- if (result)
- ldap_msgfree(result);
+ ldap_msgfree(result);
}
free(filt);
done:
tv.tv_usec = 0;
tvp = &tv;
}
- if (result != NULL) {
- ldap_msgfree(result);
- result = NULL;
- }
+ ldap_msgfree(result);
+ result = NULL;
rc = ldap_search_ext_s(ld, base->val, LDAP_SCOPE_SUBTREE,
filt, NULL, 0, NULL, NULL, tvp, 0, &result);
if (rc == LDAP_SUCCESS && (entry = ldap_first_entry(ld, result))) {
rc = 0;
done:
- if (result != NULL)
- ldap_msgfree(result);
+ ldap_msgfree(result);
free(filt);
debug_return_int(rc);