Fix bug 7045 - Bad (non memory copying) interfaces in smbc_setXXXX calls.
commitedc44312f76e14e94c56e70cf7bb49139f9f081e
authorJeremy Allison <jra@samba.org>
Sat, 16 Jan 2010 01:52:54 +0000 (15 17:52 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 18 Jan 2010 09:28:25 +0000 (18 10:28 +0100)
tree69a7ae11d874027128e2aa7763fc2cf55ac6ef87
parent07263901632bb98851d86dc0ba1d2dc22735c020
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
source/libsmb/libsmb_context.c
source/libsmb/libsmb_setget.c