ldb_controls: avoid unnecessary unchecked talloc_asprintf()s
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 22 Mar 2016 00:42:12 +0000 (13:42 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 22 Mar 2016 07:00:32 +0000 (08:00 +0100)
commit5e4f39ad60f4cf0bd3a2f793e4572b09163a4ce1
tree4fd8fa63d0863b57b2adf16d0332e458866d5ab0
parentbd6a0220f47a045590641da78e133ca9c06a6a97
ldb_controls: avoid unnecessary unchecked talloc_asprintf()s

The error paths when a control doesn't parse involved a lot of
talloc_asprintf()s and talloc_asprintf_append()s but almost no actual
printf formatting. The return values were not checked. This replaces
them with constant strings.

The one case that did use formatting looked like this:

 "invalid %s control syntax\n",  LDB_CONTROL_DIRSYNC_EX_NAME

and that has been replaced with

  "invalid dirsync_ex control syntax\n"

in line with the way it is done elsewhere.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/ldb/common/ldb_controls.c