Fix bug 5375
authorVolker Lendecke <vl@samba.org>
Mon, 7 Apr 2008 08:19:25 +0000 (10:19 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 7 Apr 2008 08:20:39 +0000 (10:20 +0200)
Thanks to Moskvin for testing

source/lib/util_str.c

index cb8a100fa7b0c44d620248b45470f20bc0f0b208..6310e2464d06e2209b4a6b9338b7351d5669e61b 100644 (file)
@@ -1972,25 +1972,26 @@ int str_list_count( const char **list )
 }
 
 /******************************************************************************
- version of standard_sub_basic() for string lists; uses alloc_sub_basic()
+ version of standard_sub_basic() for string lists; uses talloc_sub_basic()
  for the work
  *****************************************************************************/
 
 bool str_list_sub_basic( char **list, const char *smb_name,
                         const char *domain_name )
 {
+       TALLOC_CTX *ctx = list;
        char *s, *tmpstr;
 
        while ( *list ) {
                s = *list;
-               tmpstr = alloc_sub_basic(smb_name, domain_name, s);
+               tmpstr = talloc_sub_basic(ctx, smb_name, domain_name, s);
                if ( !tmpstr ) {
                        DEBUG(0,("str_list_sub_basic: "
                                "alloc_sub_basic() return NULL!\n"));
                        return false;
                }
 
-               SAFE_FREE(*list);
+               TALLOC_FREE(*list);
                *list = tmpstr;
 
                list++;