Fix bug 7045 - Bad (non memory copying) interfaces in smbc_setXXXX calls.
authorJeremy Allison <jra@samba.org>
Sat, 16 Jan 2010 01:52:54 +0000 (17:52 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 24 Feb 2010 15:25:09 +0000 (16:25 +0100)
commitb990e6614f462edb4a00f8ea5665f244a3c9ac40
tree5aa0e5a63e8c25c064e58044c2986bda1a116219
parente07bdeda53353597787183131cbe44eeeac5ec15
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 edc44312f76e14e94c56e70cf7bb49139f9f081e)
source/libsmb/libsmb_context.c
source/libsmb/libsmb_setget.c