Changeset 411 for branches/samba-3.3.x/source/libsmb/libsmb_context.c
- Timestamp:
- Mar 1, 2010, 3:05:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/libsmb/libsmb_context.c
r342 r411 193 193 194 194 /* Things we have to clean up */ 195 free(smbc_getWorkgroup(context));196 195 smbc_setWorkgroup(context, NULL); 197 198 free(smbc_getNetbiosName(context));199 196 smbc_setNetbiosName(context, NULL); 200 201 free(smbc_getUser(context));202 197 smbc_setUser(context, NULL); 203 198 … … 424 419 { 425 420 int pid; 426 char *user = NULL;427 421 char *home = NULL; 428 422 … … 533 527 * FIXME: Is this the best way to get the user info? 534 528 */ 535 529 char *user = getenv("USER"); 536 530 /* walk around as "guest" if no username can be found */ 537 531 if (!user) { … … 547 541 548 542 smbc_setUser(context, user); 543 SAFE_FREE(user); 544 545 if (!smbc_getUser(context)) { 546 errno = ENOMEM; 547 return NULL; 548 } 549 549 } 550 550 … … 579 579 580 580 smbc_setNetbiosName(context, netbios_name); 581 SAFE_FREE(netbios_name); 582 583 if (!smbc_getNetbiosName(context)) { 584 errno = ENOMEM; 585 return NULL; 586 } 581 587 } 582 588 … … 600 606 601 607 smbc_setWorkgroup(context, workgroup); 608 SAFE_FREE(workgroup); 609 610 if (!smbc_getWorkgroup(context)) { 611 errno = ENOMEM; 612 return NULL; 613 } 602 614 } 603 615
Note:
See TracChangeset
for help on using the changeset viewer.