Ignore:
Timestamp:
Mar 1, 2010, 3:05:48 PM (15 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3.x to 3.3.11

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/libsmb/libsmb_context.c

    r342 r411  
    193193       
    194194        /* Things we have to clean up */
    195         free(smbc_getWorkgroup(context));
    196195        smbc_setWorkgroup(context, NULL);
    197 
    198         free(smbc_getNetbiosName(context));
    199196        smbc_setNetbiosName(context, NULL);
    200 
    201         free(smbc_getUser(context));
    202197        smbc_setUser(context, NULL);
    203198       
     
    424419{
    425420        int pid;
    426         char *user = NULL;
    427421        char *home = NULL;
    428422       
     
    533527                 * FIXME: Is this the best way to get the user info?
    534528                 */
    535                 user = getenv("USER");
     529                char *user = getenv("USER");
    536530                /* walk around as "guest" if no username can be found */
    537531                if (!user) {
     
    547541
    548542                smbc_setUser(context, user);
     543                SAFE_FREE(user);
     544
     545                if (!smbc_getUser(context)) {
     546                        errno = ENOMEM;
     547                        return NULL;
     548                }
    549549        }
    550550       
     
    579579               
    580580                smbc_setNetbiosName(context, netbios_name);
     581                SAFE_FREE(netbios_name);
     582
     583                if (!smbc_getNetbiosName(context)) {
     584                        errno = ENOMEM;
     585                        return NULL;
     586                }
    581587        }
    582588       
     
    600606
    601607                smbc_setWorkgroup(context, workgroup);
     608                SAFE_FREE(workgroup);
     609
     610                if (!smbc_getWorkgroup(context)) {
     611                        errno = ENOMEM;
     612                        return NULL;
     613                }
    602614        }
    603615       
Note: See TracChangeset for help on using the changeset viewer.