Ticket 49385 - Fix coverity warnings
Description: This fixes coverity issues found from RHEL build of 1.3.7
https://pagure.io/389-ds-base/issue/49385
Reviewed by: lkrispenz(Thanks!)
(cherry picked from commit 805e8f4d3016eb9c7906c1416482047a234d51ba)