Fix bug 7045 - Bad (non memory copying) interfaces in smbc_setXXXX calls.
commit5e83ccd7ed865ed90cd2e975c983058dcb71eaeb
authorJeremy Allison <jra@samba.org>
Sat, 16 Jan 2010 01:45:21 +0000 (15 17:45 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 25 Jan 2010 09:59:31 +0000 (25 10:59 +0100)
treec8203e572c62151de9938a6c27d12211bf464980
parent60de807f98aec9b1dcbf3455f17988b0637540d7
Fix bug 7045 - Bad (non memory copying) interfaces in smbc_setXXXX calls.

In smbc_free_context libsmbclient just called free() on the string options
so it assumes the callers have malloced them before setting them via smbc_set
calls.

Change to correctly malloc/free string options to the library.
Protect against SMB_STRDUP of null.

Contains 2d41b1ab78639abe4ae030ff482573f464564dd7 and
f85b6ee90b88c7f7b2a92c8a5f3e2ebe59c1087b from master.

Jeremy
(cherry picked from commit e579de0c473d505c75bfeb8c583188e998666a8c)
source3/libsmb/libsmb_context.c
source3/libsmb/libsmb_setget.c