Ticket #47773 - mem leak in do_bind when there is an error

https://fedorahosted.org/389/ticket/47773
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.3.0
Fix Description: Do not get the SLAPI_BIND_TARGET_SDN from the pblock and
free it in the clean up code if it was never set in the pblock - just free
the local variable sdn in this case.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 2a57b521b86b24c0f0a8ddfbea4169c71ee4e896)
(cherry picked from commit c0606d45b91e87e4d0d90dec0812d20a0b23f545)
(cherry picked from commit 39eab765d9c6552c246bed13903807eca4c96887)
Ticket #47774 mem leak in do_search - rawbase not freed upon certain errors

https://fedorahosted.org/389/ticket/47774
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.3.0
Fix Description: Free the local rawbase variable if it was not set in the
pblock.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 1d5c6d6ca300a45305dba631a334ae9a1857d4cb)
(cherry picked from commit b065515935daa8fffe7a8eef3a66621cc8702018)
(cherry picked from commit 97f58ff4787ecb87780fde7245e354ec75e73125)
Ticket #47772 empty modify returns LDAP_INVALID_DN_SYNTAX

https://fedorahosted.org/389/ticket/47772
Reviewed by: mreynolds (Thanks!)
Branch: 389-ds-base-1.3.0
Fix Description: Do not call normalize_mods2bvals if mods is NULL - just allow
the empty modify op to proceed.  Since normalize_mods2bvals only cares about
DN syntax attributes, it is appropriate to return LDAP_INVALID_DN_SYNTAX if
normalize_mods2bvals returns NULL.
Since this fix allows NULL mods to proceed throughout the code, I checked for
all places that SLAPI_MODIFY_MODS was used, to make sure we don't try to
dereference NULL mods, and to make sure the NULL mods were handled correctly
otherwise.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry-picked with conflicts from f5730129dfbc4ef3808735051b12cbfda518f4fb)
(cherry picked from commit 469c9b9c68806e46b14595da5aec49517af60028)
(cherry picked from commit 60c36f1c6aea1913bd7f719b9efb892092317917)
Ticket #47772 empty modify returns LDAP_INVALID_DN_SYNTAX

https://fedorahosted.org/389/ticket/47772
Reviewed by: tbordaz, mreynolds (Thanks!)
Branch: 389-ds-base-1.3.0
Fix Description: tbordaz pointed out a couple of other places where the
pblock modify_mods structure is being referenced directly, and needs to be
checked for NULL.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 2d25bb4dd39d09d8b5fc5b69702d6e1cccc2c65f)
(cherry picked from commit ba5938bfa94d906c2189ebc6579057b2779ee68d)