diff options
| author | Endi S. Dewata <edewata@redhat.com> | 2010-07-12 23:07:47 -0500 |
|---|---|---|
| committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-19 13:06:03 -0700 |
| commit | 0db028fd9d116eb913289b6fefcab56c7a38dab6 (patch) | |
| tree | a34e2b355b782bc41e2fe6a008957f089d59ad0f | |
| parent | ca3ad2b93cfaf1dc427f81230e79fe9862fdd2f9 (diff) | |
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
https://bugzilla.redhat.com/show_bug.cgi?id=614511
Resolves: bug 614511
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
description: Catch possible NULL pointer in linked_attrs_modrdn_post_op().
| -rw-r--r-- | ldap/servers/plugins/linkedattrs/linked_attrs.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ldap/servers/plugins/linkedattrs/linked_attrs.c b/ldap/servers/plugins/linkedattrs/linked_attrs.c index 822f6c0e..61099423 100644 --- a/ldap/servers/plugins/linkedattrs/linked_attrs.c +++ b/ldap/servers/plugins/linkedattrs/linked_attrs.c @@ -1836,13 +1836,15 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) Slapi_Attr *attr = NULL; char *type = NULL; struct configEntry *config = NULL; + int rc = 0; slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "--> linked_attrs_modrdn_post_op\n"); /* Just bail if we aren't ready to service requests yet. */ - if (!g_plugin_started || !linked_attrs_oktodo(pb)) - return 0;; + if (!g_plugin_started || !linked_attrs_oktodo(pb)) { + goto done; + } /* Reload config if an existing config entry was renamed, * or if the new dn brings an entry into the scope of the @@ -1854,6 +1856,8 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_modrdn_post_op: Error " "retrieving post-op entry\n"); + rc = LDAP_OPERATIONS_ERROR; + goto done; } if ((old_dn = linked_attrs_get_dn(pb))) { @@ -1863,6 +1867,8 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) slapi_log_error(SLAPI_LOG_PLUGIN, LINK_PLUGIN_SUBSYSTEM, "linked_attrs_modrdn_post_op: Error " "retrieving dn\n"); + rc = LDAP_OPERATIONS_ERROR; + goto done; } /* Check if this operation requires any updates to links. */ @@ -1956,11 +1962,11 @@ linked_attrs_modrdn_post_op(Slapi_PBlock *pb) slapi_entry_next_attr(post_e, attr, &attr); } - +done: slapi_log_error(SLAPI_LOG_TRACE, LINK_PLUGIN_SUBSYSTEM, "<-- linked_attrs_modrdn_post_op\n"); - return 0; + return rc; } |
