Changeset 454 for trunk/src/sh_unix.c
- Timestamp:
- Jun 29, 2014, 7:30:04 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_unix.c
r436 r454 1475 1475 1476 1476 /* printf("-> %2d: slots allocated\n", envlen); */ 1477 env1 = malloc (sizeof(char *) * envlen); /* only once */1477 env1 = calloc(1,sizeof(char *) * envlen); /* only once */ 1478 1478 if (env1 == NULL) 1479 1479 { … … 1486 1486 while (env0 != NULL && env0[envlen] != NULL) { 1487 1487 len = strlen(env0[envlen]) + 1; 1488 env1[envlen] = malloc (len); /* only once */1488 env1[envlen] = calloc(1,len); /* only once */ 1489 1489 if (env1[envlen] == NULL) 1490 1490 { … … 1910 1910 { 1911 1911 len = strlen(str) + 1; 1912 chroot_dir = malloc(strlen(str) + 1); /* only once */1912 chroot_dir = calloc(1,strlen(str) + 1); /* only once */ 1913 1913 if (!chroot_dir) 1914 1914 { … … 4349 4349 sh_error_handle (level, FIL__, __LINE__, stat_return, 4350 4350 MSG_FI_STAT, 4351 _("lstat "),4351 _("lstat (link target)"), 4352 4352 sh_error_message (stat_return,errbuf, sizeof(errbuf)), 4353 4353 (long) euid, … … 5568 5568 ptr = pthread_getspecific(gSigtrapVariables_key); 5569 5569 if (ptr == NULL) { 5570 ptr = malloc(sizeof(struct sh_sigtrap_variables));5570 ptr = calloc(1,sizeof(struct sh_sigtrap_variables)); 5571 5571 if (ptr == NULL) { 5572 5572 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.