ldb: Fix mem-leak if talloc_realloc fails
authorSwen Schillig <swen@linux.ibm.com>
Wed, 31 Jul 2019 08:27:37 +0000 (10:27 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 4 Sep 2019 08:31:24 +0000 (08:31 +0000)
commit57f00784ffac527a0f9b830339bba24784f2e294
tree27506f1bbd7216a4e2c5e409bfbca07fda031faf
parent7cf6afba65641f48a5e2c326464fd97fd9f4173c
ldb: Fix mem-leak if talloc_realloc fails

In case of a failing talloc_realloc(), the only reference
to the originally allocated memory is overwritten.
Instead use a temp var until success is verified.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 99b4791cfe423b19f1f21d5f9fb42157336019f1)
lib/ldb/common/ldb_dn.c