Changeset 454 for trunk/src/slib.c
- Timestamp:
- Jun 29, 2014, 7:30:04 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/slib.c
r412 r454 1493 1493 char * buffer; 1494 1494 struct passwd * tempres; 1495 buffer = malloc(SH_PWBUF_SIZE);1495 buffer = calloc(1,SH_PWBUF_SIZE); 1496 1496 SL_REQUIRE (buffer != NULL, _("buffer != NULL")); 1497 1497 sh_getpwnam_r(user, &pwd, buffer, SH_PWBUF_SIZE, &tempres); … … 1542 1542 char * buffer; 1543 1543 struct passwd * tempres; 1544 buffer = malloc(SH_PWBUF_SIZE);1544 buffer = calloc(1,SH_PWBUF_SIZE); 1545 1545 SL_REQUIRE (buffer != NULL, _("buffer != NULL")); 1546 1546 sh_getpwnam_r(user, &pwd, buffer, SH_PWBUF_SIZE, &tempres); … … 1756 1756 } 1757 1757 1758 if ( (ofiles[fd] = (SL_OFILE *) malloc(sizeof(SL_OFILE))) == NULL)1758 if ( (ofiles[fd] = calloc(1,sizeof(SL_OFILE))) == NULL) 1759 1759 { 1760 1760 SL_IRETURN(SL_EMEM, _("sl_make_ticket")); … … 1763 1763 len = sl_strlen(filename)+1; 1764 1764 1765 if ( (ofiles[fd]->path = (char *) malloc(len) ) == NULL)1765 if ( (ofiles[fd]->path = calloc(1,len) ) == NULL) 1766 1766 { 1767 1767 free (ofiles[fd]); … … 2032 2032 } 2033 2033 2034 if ( (ofiles[fd] = (SL_OFILE *) malloc(sizeof(SL_OFILE))) == NULL)2034 if ( (ofiles[fd] = calloc(1,sizeof(SL_OFILE))) == NULL) 2035 2035 { 2036 2036 sl_close_fd(FIL__, __LINE__, fd); … … 2040 2040 len = sl_strlen(filename)+1; 2041 2041 2042 if ( (ofiles[fd]->path = (char *) malloc(len) ) == NULL)2042 if ( (ofiles[fd]->path = calloc(1,len) ) == NULL) 2043 2043 { 2044 2044 free (ofiles[fd]);
Note:
See TracChangeset
for help on using the changeset viewer.