|
Lines 233-239
Link Here
|
| 233 |
if (!sp) |
233 |
if (!sp) |
| 234 |
return NULL; |
234 |
return NULL; |
| 235 |
|
235 |
|
| 236 |
new_sp = (SPOOL_NOTIFY_OPTION *)malloc(sizeof(SPOOL_NOTIFY_OPTION)); |
236 |
new_sp = SMB_MALLOC_P(SPOOL_NOTIFY_OPTION); |
| 237 |
if (!new_sp) |
237 |
if (!new_sp) |
| 238 |
return NULL; |
238 |
return NULL; |
| 239 |
|
239 |
|
|
Lines 494-500
Link Here
|
| 494 |
|
494 |
|
| 495 |
DEBUG(10,("open_printer_hnd: name [%s]\n", name)); |
495 |
DEBUG(10,("open_printer_hnd: name [%s]\n", name)); |
| 496 |
|
496 |
|
| 497 |
if((new_printer=(Printer_entry *)malloc(sizeof(Printer_entry))) == NULL) |
497 |
if((new_printer=SMB_MALLOC_P(Printer_entry)) == NULL) |
| 498 |
return False; |
498 |
return False; |
| 499 |
|
499 |
|
| 500 |
ZERO_STRUCTP(new_printer); |
500 |
ZERO_STRUCTP(new_printer); |
|
Lines 872-878
Link Here
|
| 872 |
|
872 |
|
| 873 |
/* bulk copy first */ |
873 |
/* bulk copy first */ |
| 874 |
|
874 |
|
| 875 |
d = talloc_memdup(ctx, devmode, sizeof(DEVICEMODE)); |
875 |
d = TALLOC_MEMDUP(ctx, devmode, sizeof(DEVICEMODE)); |
| 876 |
if (!d) |
876 |
if (!d) |
| 877 |
return NULL; |
877 |
return NULL; |
| 878 |
|
878 |
|
|
Lines 880-886
Link Here
|
| 880 |
|
880 |
|
| 881 |
len = unistrlen(devmode->devicename.buffer); |
881 |
len = unistrlen(devmode->devicename.buffer); |
| 882 |
if (len != -1) { |
882 |
if (len != -1) { |
| 883 |
d->devicename.buffer = talloc(ctx, len*2); |
883 |
d->devicename.buffer = TALLOC_ARRAY(ctx, uint16, len); |
| 884 |
if (unistrcpy(d->devicename.buffer, devmode->devicename.buffer) != len) |
884 |
if (unistrcpy(d->devicename.buffer, devmode->devicename.buffer) != len) |
| 885 |
return NULL; |
885 |
return NULL; |
| 886 |
} |
886 |
} |
|
Lines 888-899
Link Here
|
| 888 |
|
888 |
|
| 889 |
len = unistrlen(devmode->formname.buffer); |
889 |
len = unistrlen(devmode->formname.buffer); |
| 890 |
if (len != -1) { |
890 |
if (len != -1) { |
| 891 |
d->devicename.buffer = talloc(ctx, len*2); |
891 |
d->devicename.buffer = TALLOC_ARRAY(ctx, uint16, len); |
| 892 |
if (unistrcpy(d->formname.buffer, devmode->formname.buffer) != len) |
892 |
if (unistrcpy(d->formname.buffer, devmode->formname.buffer) != len) |
| 893 |
return NULL; |
893 |
return NULL; |
| 894 |
} |
894 |
} |
| 895 |
|
895 |
|
| 896 |
d->private = talloc_memdup(ctx, devmode->private, devmode->driverextra); |
896 |
d->private = TALLOC_MEMDUP(ctx, devmode->private, devmode->driverextra); |
| 897 |
|
897 |
|
| 898 |
return d; |
898 |
return d; |
| 899 |
} |
899 |
} |
|
Lines 1305-1311
Link Here
|
| 1305 |
if ((devmode->driverextra != 0) && (devmode->private != NULL)) { |
1305 |
if ((devmode->driverextra != 0) && (devmode->private != NULL)) { |
| 1306 |
SAFE_FREE(nt_devmode->private); |
1306 |
SAFE_FREE(nt_devmode->private); |
| 1307 |
nt_devmode->driverextra=devmode->driverextra; |
1307 |
nt_devmode->driverextra=devmode->driverextra; |
| 1308 |
if((nt_devmode->private=(uint8 *)malloc(nt_devmode->driverextra * sizeof(uint8))) == NULL) |
1308 |
if((nt_devmode->private=SMB_MALLOC_ARRAY(uint8, nt_devmode->driverextra)) == NULL) |
| 1309 |
return False; |
1309 |
return False; |
| 1310 |
memcpy(nt_devmode->private, devmode->private, nt_devmode->driverextra); |
1310 |
memcpy(nt_devmode->private, devmode->private, nt_devmode->driverextra); |
| 1311 |
} |
1311 |
} |
|
Lines 1521-1527
Link Here
|
| 1521 |
|
1521 |
|
| 1522 |
if (!strcmp(value, "W3SvcInstalled")) { |
1522 |
if (!strcmp(value, "W3SvcInstalled")) { |
| 1523 |
*type = 0x4; |
1523 |
*type = 0x4; |
| 1524 |
if((*data = (uint8 *)talloc_zero(ctx, 4*sizeof(uint8) )) == NULL) |
1524 |
if((*data = (uint8 *)TALLOC_ZERO(ctx, 4*sizeof(uint8) )) == NULL) |
| 1525 |
return False; |
1525 |
return False; |
| 1526 |
*needed = 0x4; |
1526 |
*needed = 0x4; |
| 1527 |
return True; |
1527 |
return True; |
|
Lines 1529-1535
Link Here
|
| 1529 |
|
1529 |
|
| 1530 |
if (!strcmp(value, "BeepEnabled")) { |
1530 |
if (!strcmp(value, "BeepEnabled")) { |
| 1531 |
*type = 0x4; |
1531 |
*type = 0x4; |
| 1532 |
if((*data = (uint8 *)talloc(ctx, 4*sizeof(uint8) )) == NULL) |
1532 |
if((*data = (uint8 *)TALLOC(ctx, 4*sizeof(uint8) )) == NULL) |
| 1533 |
return False; |
1533 |
return False; |
| 1534 |
SIVAL(*data, 0, 0x00); |
1534 |
SIVAL(*data, 0, 0x00); |
| 1535 |
*needed = 0x4; |
1535 |
*needed = 0x4; |
|
Lines 1538-1544
Link Here
|
| 1538 |
|
1538 |
|
| 1539 |
if (!strcmp(value, "EventLog")) { |
1539 |
if (!strcmp(value, "EventLog")) { |
| 1540 |
*type = 0x4; |
1540 |
*type = 0x4; |
| 1541 |
if((*data = (uint8 *)talloc(ctx, 4*sizeof(uint8) )) == NULL) |
1541 |
if((*data = (uint8 *)TALLOC(ctx, 4*sizeof(uint8) )) == NULL) |
| 1542 |
return False; |
1542 |
return False; |
| 1543 |
/* formally was 0x1b */ |
1543 |
/* formally was 0x1b */ |
| 1544 |
SIVAL(*data, 0, 0x0); |
1544 |
SIVAL(*data, 0, 0x0); |
|
Lines 1548-1554
Link Here
|
| 1548 |
|
1548 |
|
| 1549 |
if (!strcmp(value, "NetPopup")) { |
1549 |
if (!strcmp(value, "NetPopup")) { |
| 1550 |
*type = 0x4; |
1550 |
*type = 0x4; |
| 1551 |
if((*data = (uint8 *)talloc(ctx, 4*sizeof(uint8) )) == NULL) |
1551 |
if((*data = (uint8 *)TALLOC(ctx, 4*sizeof(uint8) )) == NULL) |
| 1552 |
return False; |
1552 |
return False; |
| 1553 |
SIVAL(*data, 0, 0x00); |
1553 |
SIVAL(*data, 0, 0x00); |
| 1554 |
*needed = 0x4; |
1554 |
*needed = 0x4; |
|
Lines 1557-1563
Link Here
|
| 1557 |
|
1557 |
|
| 1558 |
if (!strcmp(value, "MajorVersion")) { |
1558 |
if (!strcmp(value, "MajorVersion")) { |
| 1559 |
*type = 0x4; |
1559 |
*type = 0x4; |
| 1560 |
if((*data = (uint8 *)talloc(ctx, 4*sizeof(uint8) )) == NULL) |
1560 |
if((*data = (uint8 *)TALLOC(ctx, 4*sizeof(uint8) )) == NULL) |
| 1561 |
return False; |
1561 |
return False; |
| 1562 |
#ifndef EMULATE_WIN2K_HACK /* JERRY */ |
1562 |
#ifndef EMULATE_WIN2K_HACK /* JERRY */ |
| 1563 |
SIVAL(*data, 0, 2); |
1563 |
SIVAL(*data, 0, 2); |
|
Lines 1574-1580
Link Here
|
| 1574 |
fstrcpy(string, string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH)); |
1574 |
fstrcpy(string, string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH)); |
| 1575 |
*type = 0x1; |
1575 |
*type = 0x1; |
| 1576 |
*needed = 2*(strlen(string)+1); |
1576 |
*needed = 2*(strlen(string)+1); |
| 1577 |
if((*data = (uint8 *)talloc(ctx, ((*needed > in_size) ? *needed:in_size) *sizeof(uint8))) == NULL) |
1577 |
if((*data = (uint8 *)TALLOC(ctx, ((*needed > in_size) ? *needed:in_size) *sizeof(uint8))) == NULL) |
| 1578 |
return False; |
1578 |
return False; |
| 1579 |
memset(*data, 0, (*needed > in_size) ? *needed:in_size); |
1579 |
memset(*data, 0, (*needed > in_size) ? *needed:in_size); |
| 1580 |
|
1580 |
|
|
Lines 1590-1596
Link Here
|
| 1590 |
pstring string="Windows NT x86"; |
1590 |
pstring string="Windows NT x86"; |
| 1591 |
*type = 0x1; |
1591 |
*type = 0x1; |
| 1592 |
*needed = 2*(strlen(string)+1); |
1592 |
*needed = 2*(strlen(string)+1); |
| 1593 |
if((*data = (uint8 *)talloc(ctx, ((*needed > in_size) ? *needed:in_size) *sizeof(uint8))) == NULL) |
1593 |
if((*data = (uint8 *)TALLOC(ctx, ((*needed > in_size) ? *needed:in_size) *sizeof(uint8))) == NULL) |
| 1594 |
return False; |
1594 |
return False; |
| 1595 |
memset(*data, 0, (*needed > in_size) ? *needed:in_size); |
1595 |
memset(*data, 0, (*needed > in_size) ? *needed:in_size); |
| 1596 |
for (i=0; i<strlen(string); i++) { |
1596 |
for (i=0; i<strlen(string); i++) { |
|
Lines 1640-1646
Link Here
|
| 1640 |
DEBUG(5,("getprinterdata_printer:allocating %d\n", in_size)); |
1640 |
DEBUG(5,("getprinterdata_printer:allocating %d\n", in_size)); |
| 1641 |
|
1641 |
|
| 1642 |
if (in_size) { |
1642 |
if (in_size) { |
| 1643 |
if((*data = (uint8 *)talloc(ctx, in_size *sizeof(uint8) )) == NULL) { |
1643 |
if((*data = TALLOC_ARRAY(ctx, uint8, in_size )) == NULL) { |
| 1644 |
return False; |
1644 |
return False; |
| 1645 |
} |
1645 |
} |
| 1646 |
|
1646 |
|
|
Lines 1694-1700
Link Here
|
| 1694 |
DEBUG(4,("_spoolss_getprinterdata\n")); |
1694 |
DEBUG(4,("_spoolss_getprinterdata\n")); |
| 1695 |
|
1695 |
|
| 1696 |
if (!Printer) { |
1696 |
if (!Printer) { |
| 1697 |
if((*data=(uint8 *)talloc_zero(p->mem_ctx, 4*sizeof(uint8))) == NULL) |
1697 |
if((*data=TALLOC_ZERO_ARRAY(p->mem_ctx, uint8, 4)) == NULL) |
| 1698 |
return WERR_NOMEM; |
1698 |
return WERR_NOMEM; |
| 1699 |
DEBUG(2,("_spoolss_getprinterdata: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle))); |
1699 |
DEBUG(2,("_spoolss_getprinterdata: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle))); |
| 1700 |
return WERR_BADFID; |
1700 |
return WERR_BADFID; |
|
Lines 1711-1717
Link Here
|
| 1711 |
DEBUG(5, ("value not found, allocating %d\n", *out_size)); |
1711 |
DEBUG(5, ("value not found, allocating %d\n", *out_size)); |
| 1712 |
/* reply this param doesn't exist */ |
1712 |
/* reply this param doesn't exist */ |
| 1713 |
if (*out_size) { |
1713 |
if (*out_size) { |
| 1714 |
if((*data=(uint8 *)talloc_zero(p->mem_ctx, *out_size*sizeof(uint8))) == NULL) |
1714 |
if((*data=TALLOC_ZERO_ARRAY(p->mem_ctx, uint8, *out_size)) == NULL) |
| 1715 |
return WERR_NOMEM; |
1715 |
return WERR_NOMEM; |
| 1716 |
} else { |
1716 |
} else { |
| 1717 |
*data = NULL; |
1717 |
*data = NULL; |
|
Lines 1837-1843
Link Here
|
| 1837 |
len = (uint32)dos_PutUniCode(temp, temp_name, sizeof(temp) - 2, True); |
1837 |
len = (uint32)dos_PutUniCode(temp, temp_name, sizeof(temp) - 2, True); |
| 1838 |
|
1838 |
|
| 1839 |
data->notify_data.data.length = len / 2 - 1; |
1839 |
data->notify_data.data.length = len / 2 - 1; |
| 1840 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
1840 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 1841 |
|
1841 |
|
| 1842 |
if (!data->notify_data.data.string) { |
1842 |
if (!data->notify_data.data.string) { |
| 1843 |
data->notify_data.data.length = 0; |
1843 |
data->notify_data.data.length = 0; |
|
Lines 1872-1878
Link Here
|
| 1872 |
len = (uint32)dos_PutUniCode(temp, p, sizeof(temp) - 2, True); |
1872 |
len = (uint32)dos_PutUniCode(temp, p, sizeof(temp) - 2, True); |
| 1873 |
|
1873 |
|
| 1874 |
data->notify_data.data.length = len / 2 - 1; |
1874 |
data->notify_data.data.length = len / 2 - 1; |
| 1875 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
1875 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 1876 |
|
1876 |
|
| 1877 |
if (!data->notify_data.data.string) { |
1877 |
if (!data->notify_data.data.string) { |
| 1878 |
data->notify_data.data.length = 0; |
1878 |
data->notify_data.data.length = 0; |
|
Lines 1899-1905
Link Here
|
| 1899 |
sizeof(temp) - 2, True); |
1899 |
sizeof(temp) - 2, True); |
| 1900 |
|
1900 |
|
| 1901 |
data->notify_data.data.length = len / 2 - 1; |
1901 |
data->notify_data.data.length = len / 2 - 1; |
| 1902 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
1902 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 1903 |
|
1903 |
|
| 1904 |
if (!data->notify_data.data.string) { |
1904 |
if (!data->notify_data.data.string) { |
| 1905 |
data->notify_data.data.length = 0; |
1905 |
data->notify_data.data.length = 0; |
|
Lines 1928-1934
Link Here
|
| 1928 |
sizeof(temp) - 2, True); |
1928 |
sizeof(temp) - 2, True); |
| 1929 |
|
1929 |
|
| 1930 |
data->notify_data.data.length = len / 2 - 1; |
1930 |
data->notify_data.data.length = len / 2 - 1; |
| 1931 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
1931 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 1932 |
|
1932 |
|
| 1933 |
if (!data->notify_data.data.string) { |
1933 |
if (!data->notify_data.data.string) { |
| 1934 |
data->notify_data.data.length = 0; |
1934 |
data->notify_data.data.length = 0; |
|
Lines 1956-1962
Link Here
|
| 1956 |
sizeof(temp) - 2, True); |
1956 |
sizeof(temp) - 2, True); |
| 1957 |
|
1957 |
|
| 1958 |
data->notify_data.data.length = len / 2 - 1; |
1958 |
data->notify_data.data.length = len / 2 - 1; |
| 1959 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
1959 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 1960 |
|
1960 |
|
| 1961 |
if (!data->notify_data.data.string) { |
1961 |
if (!data->notify_data.data.string) { |
| 1962 |
data->notify_data.data.length = 0; |
1962 |
data->notify_data.data.length = 0; |
|
Lines 1987-1993
Link Here
|
| 1987 |
sizeof(temp) - 2, True); |
1987 |
sizeof(temp) - 2, True); |
| 1988 |
|
1988 |
|
| 1989 |
data->notify_data.data.length = len / 2 - 1; |
1989 |
data->notify_data.data.length = len / 2 - 1; |
| 1990 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
1990 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 1991 |
|
1991 |
|
| 1992 |
if (!data->notify_data.data.string) { |
1992 |
if (!data->notify_data.data.string) { |
| 1993 |
data->notify_data.data.length = 0; |
1993 |
data->notify_data.data.length = 0; |
|
Lines 2015-2021
Link Here
|
| 2015 |
sizeof(temp) - 2, True); |
2015 |
sizeof(temp) - 2, True); |
| 2016 |
|
2016 |
|
| 2017 |
data->notify_data.data.length = len / 2 - 1; |
2017 |
data->notify_data.data.length = len / 2 - 1; |
| 2018 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
2018 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 2019 |
|
2019 |
|
| 2020 |
if (!data->notify_data.data.string) { |
2020 |
if (!data->notify_data.data.string) { |
| 2021 |
data->notify_data.data.length = 0; |
2021 |
data->notify_data.data.length = 0; |
|
Lines 2055-2061
Link Here
|
| 2055 |
sizeof(temp) - 2, True); |
2055 |
sizeof(temp) - 2, True); |
| 2056 |
|
2056 |
|
| 2057 |
data->notify_data.data.length = len / 2 - 1; |
2057 |
data->notify_data.data.length = len / 2 - 1; |
| 2058 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
2058 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 2059 |
|
2059 |
|
| 2060 |
if (!data->notify_data.data.string) { |
2060 |
if (!data->notify_data.data.string) { |
| 2061 |
data->notify_data.data.length = 0; |
2061 |
data->notify_data.data.length = 0; |
|
Lines 2083-2089
Link Here
|
| 2083 |
sizeof(temp) - 2, True); |
2083 |
sizeof(temp) - 2, True); |
| 2084 |
|
2084 |
|
| 2085 |
data->notify_data.data.length = len / 2 - 1; |
2085 |
data->notify_data.data.length = len / 2 - 1; |
| 2086 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
2086 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 2087 |
|
2087 |
|
| 2088 |
if (!data->notify_data.data.string) { |
2088 |
if (!data->notify_data.data.string) { |
| 2089 |
data->notify_data.data.length = 0; |
2089 |
data->notify_data.data.length = 0; |
|
Lines 2111-2117
Link Here
|
| 2111 |
sizeof(temp) - 2, True); |
2111 |
sizeof(temp) - 2, True); |
| 2112 |
|
2112 |
|
| 2113 |
data->notify_data.data.length = len / 2 - 1; |
2113 |
data->notify_data.data.length = len / 2 - 1; |
| 2114 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
2114 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 2115 |
|
2115 |
|
| 2116 |
if (!data->notify_data.data.string) { |
2116 |
if (!data->notify_data.data.string) { |
| 2117 |
data->notify_data.data.length = 0; |
2117 |
data->notify_data.data.length = 0; |
|
Lines 2139-2145
Link Here
|
| 2139 |
sizeof(pstring) - 2, True); |
2139 |
sizeof(pstring) - 2, True); |
| 2140 |
|
2140 |
|
| 2141 |
data->notify_data.data.length = len / 2 - 1; |
2141 |
data->notify_data.data.length = len / 2 - 1; |
| 2142 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
2142 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 2143 |
|
2143 |
|
| 2144 |
if (!data->notify_data.data.string) { |
2144 |
if (!data->notify_data.data.string) { |
| 2145 |
data->notify_data.data.length = 0; |
2145 |
data->notify_data.data.length = 0; |
|
Lines 2300-2306
Link Here
|
| 2300 |
sizeof(temp) - 2, True); |
2300 |
sizeof(temp) - 2, True); |
| 2301 |
|
2301 |
|
| 2302 |
data->notify_data.data.length = len / 2 - 1; |
2302 |
data->notify_data.data.length = len / 2 - 1; |
| 2303 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
2303 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 2304 |
|
2304 |
|
| 2305 |
if (!data->notify_data.data.string) { |
2305 |
if (!data->notify_data.data.string) { |
| 2306 |
data->notify_data.data.length = 0; |
2306 |
data->notify_data.data.length = 0; |
|
Lines 2341-2347
Link Here
|
| 2341 |
True); |
2341 |
True); |
| 2342 |
|
2342 |
|
| 2343 |
data->notify_data.data.length = len / 2 - 1; |
2343 |
data->notify_data.data.length = len / 2 - 1; |
| 2344 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
2344 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 2345 |
|
2345 |
|
| 2346 |
if (!data->notify_data.data.string) { |
2346 |
if (!data->notify_data.data.string) { |
| 2347 |
data->notify_data.data.length = 0; |
2347 |
data->notify_data.data.length = 0; |
|
Lines 2391-2397
Link Here
|
| 2391 |
len = (uint32)dos_PutUniCode(temp, p, sizeof(temp) - 2, True); |
2391 |
len = (uint32)dos_PutUniCode(temp, p, sizeof(temp) - 2, True); |
| 2392 |
|
2392 |
|
| 2393 |
data->notify_data.data.length = len / 2 - 1; |
2393 |
data->notify_data.data.length = len / 2 - 1; |
| 2394 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
2394 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 2395 |
|
2395 |
|
| 2396 |
if (!data->notify_data.data.string) { |
2396 |
if (!data->notify_data.data.string) { |
| 2397 |
data->notify_data.data.length = 0; |
2397 |
data->notify_data.data.length = 0; |
|
Lines 2489-2495
Link Here
|
| 2489 |
len = sizeof(SYSTEMTIME); |
2489 |
len = sizeof(SYSTEMTIME); |
| 2490 |
|
2490 |
|
| 2491 |
data->notify_data.data.length = len; |
2491 |
data->notify_data.data.length = len; |
| 2492 |
data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len); |
2492 |
data->notify_data.data.string = (uint16 *)TALLOC(mem_ctx, len); |
| 2493 |
|
2493 |
|
| 2494 |
if (!data->notify_data.data.string) { |
2494 |
if (!data->notify_data.data.string) { |
| 2495 |
data->notify_data.data.length = 0; |
2495 |
data->notify_data.data.length = 0; |
|
Lines 2704-2710
Link Here
|
| 2704 |
if (!search_notify(type, field, &j) ) |
2704 |
if (!search_notify(type, field, &j) ) |
| 2705 |
continue; |
2705 |
continue; |
| 2706 |
|
2706 |
|
| 2707 |
if((tid=(SPOOL_NOTIFY_INFO_DATA *)Realloc(info->data, (info->count+1)*sizeof(SPOOL_NOTIFY_INFO_DATA))) == NULL) { |
2707 |
if((tid=SMB_REALLOC_ARRAY( info->data, SPOOL_NOTIFY_INFO_DATA, info->count+1 )) == NULL) { |
| 2708 |
DEBUG(2,("construct_notify_printer_info: failed to enlarge buffer info->data!\n")); |
2708 |
DEBUG(2,("construct_notify_printer_info: failed to enlarge buffer info->data!\n")); |
| 2709 |
return False; |
2709 |
return False; |
| 2710 |
} |
2710 |
} |
|
Lines 2760-2766
Link Here
|
| 2760 |
if (!search_notify(type, field, &j) ) |
2760 |
if (!search_notify(type, field, &j) ) |
| 2761 |
continue; |
2761 |
continue; |
| 2762 |
|
2762 |
|
| 2763 |
if((tid=Realloc(info->data, (info->count+1)*sizeof(SPOOL_NOTIFY_INFO_DATA))) == NULL) { |
2763 |
if((tid=SMB_REALLOC_ARRAY( info->data, SPOOL_NOTIFY_INFO_DATA, info->count+1 )) == NULL) { |
| 2764 |
DEBUG(2,("construct_notify_jobs_info: failed to enlarg buffer info->data!\n")); |
2764 |
DEBUG(2,("construct_notify_jobs_info: failed to enlarg buffer info->data!\n")); |
| 2765 |
return False; |
2765 |
return False; |
| 2766 |
} |
2766 |
} |
|
Lines 3040-3046
Link Here
|
| 3040 |
|
3040 |
|
| 3041 |
/* it's the first time, add it to the list */ |
3041 |
/* it's the first time, add it to the list */ |
| 3042 |
if (session_counter==NULL) { |
3042 |
if (session_counter==NULL) { |
| 3043 |
if((session_counter=(counter_printer_0 *)malloc(sizeof(counter_printer_0))) == NULL) { |
3043 |
if((session_counter=SMB_MALLOC_P(counter_printer_0)) == NULL) { |
| 3044 |
free_a_printer(&ntprinter, 2); |
3044 |
free_a_printer(&ntprinter, 2); |
| 3045 |
return False; |
3045 |
return False; |
| 3046 |
} |
3046 |
} |
|
Lines 3184-3190
Link Here
|
| 3184 |
|
3184 |
|
| 3185 |
DEBUGADD(8,("getting printer characteristics\n")); |
3185 |
DEBUGADD(8,("getting printer characteristics\n")); |
| 3186 |
|
3186 |
|
| 3187 |
if ((devmode = (DEVICEMODE *)malloc(sizeof(DEVICEMODE))) == NULL) { |
3187 |
if ((devmode = SMB_MALLOC_P(DEVICEMODE)) == NULL) { |
| 3188 |
DEBUG(2,("construct_dev_mode: malloc fail.\n")); |
3188 |
DEBUG(2,("construct_dev_mode: malloc fail.\n")); |
| 3189 |
return NULL; |
3189 |
return NULL; |
| 3190 |
} |
3190 |
} |
|
Lines 3330-3336
Link Here
|
| 3330 |
return False; |
3330 |
return False; |
| 3331 |
|
3331 |
|
| 3332 |
*pp_printer = NULL; |
3332 |
*pp_printer = NULL; |
| 3333 |
if ((printer = (PRINTER_INFO_3 *)malloc(sizeof(PRINTER_INFO_3))) == NULL) { |
3333 |
if ((printer = SMB_MALLOC_P(PRINTER_INFO_3)) == NULL) { |
| 3334 |
DEBUG(2,("construct_printer_info_3: malloc fail.\n")); |
3334 |
DEBUG(2,("construct_printer_info_3: malloc fail.\n")); |
| 3335 |
return False; |
3335 |
return False; |
| 3336 |
} |
3336 |
} |
|
Lines 3432-3438
Link Here
|
| 3432 |
DEBUG(4,("Found a printer in smb.conf: %s[%x]\n", lp_servicename(snum), snum)); |
3432 |
DEBUG(4,("Found a printer in smb.conf: %s[%x]\n", lp_servicename(snum), snum)); |
| 3433 |
|
3433 |
|
| 3434 |
if (construct_printer_info_1(flags, ¤t_prt, snum)) { |
3434 |
if (construct_printer_info_1(flags, ¤t_prt, snum)) { |
| 3435 |
if((tp=Realloc(printers, (*returned +1)*sizeof(PRINTER_INFO_1))) == NULL) { |
3435 |
if((tp=SMB_REALLOC_ARRAY( printers, PRINTER_INFO_1, *returned +1 )) == NULL) { |
| 3436 |
DEBUG(2,("enum_all_printers_info_1: failed to enlarge printers buffer!\n")); |
3436 |
DEBUG(2,("enum_all_printers_info_1: failed to enlarge printers buffer!\n")); |
| 3437 |
SAFE_FREE(printers); |
3437 |
SAFE_FREE(printers); |
| 3438 |
*returned=0; |
3438 |
*returned=0; |
|
Lines 3519-3525
Link Here
|
| 3519 |
* We should have a TDB here. The registration is done thru an undocumented RPC call. |
3519 |
* We should have a TDB here. The registration is done thru an undocumented RPC call. |
| 3520 |
*/ |
3520 |
*/ |
| 3521 |
|
3521 |
|
| 3522 |
if((printer=(PRINTER_INFO_1 *)malloc(sizeof(PRINTER_INFO_1))) == NULL) |
3522 |
if((printer=SMB_MALLOC_P(PRINTER_INFO_1)) == NULL) |
| 3523 |
return WERR_NOMEM; |
3523 |
return WERR_NOMEM; |
| 3524 |
|
3524 |
|
| 3525 |
*returned=1; |
3525 |
*returned=1; |
|
Lines 3601-3607
Link Here
|
| 3601 |
DEBUG(4,("Found a printer in smb.conf: %s[%x]\n", lp_servicename(snum), snum)); |
3601 |
DEBUG(4,("Found a printer in smb.conf: %s[%x]\n", lp_servicename(snum), snum)); |
| 3602 |
|
3602 |
|
| 3603 |
if (construct_printer_info_2(¤t_prt, snum)) { |
3603 |
if (construct_printer_info_2(¤t_prt, snum)) { |
| 3604 |
if((tp=Realloc(printers, (*returned +1)*sizeof(PRINTER_INFO_2))) == NULL) { |
3604 |
if((tp=SMB_REALLOC_ARRAY( printers, PRINTER_INFO_2, *returned +1 )) == NULL) { |
| 3605 |
DEBUG(2,("enum_all_printers_info_2: failed to enlarge printers buffer!\n")); |
3605 |
DEBUG(2,("enum_all_printers_info_2: failed to enlarge printers buffer!\n")); |
| 3606 |
SAFE_FREE(printers); |
3606 |
SAFE_FREE(printers); |
| 3607 |
*returned = 0; |
3607 |
*returned = 0; |
|
Lines 3775-3781
Link Here
|
| 3775 |
{ |
3775 |
{ |
| 3776 |
PRINTER_INFO_0 *printer=NULL; |
3776 |
PRINTER_INFO_0 *printer=NULL; |
| 3777 |
|
3777 |
|
| 3778 |
if((printer=(PRINTER_INFO_0*)malloc(sizeof(PRINTER_INFO_0))) == NULL) |
3778 |
if((printer=SMB_MALLOC_P(PRINTER_INFO_0)) == NULL) |
| 3779 |
return WERR_NOMEM; |
3779 |
return WERR_NOMEM; |
| 3780 |
|
3780 |
|
| 3781 |
construct_printer_info_0(printer, snum); |
3781 |
construct_printer_info_0(printer, snum); |
|
Lines 3808-3814
Link Here
|
| 3808 |
{ |
3808 |
{ |
| 3809 |
PRINTER_INFO_1 *printer=NULL; |
3809 |
PRINTER_INFO_1 *printer=NULL; |
| 3810 |
|
3810 |
|
| 3811 |
if((printer=(PRINTER_INFO_1*)malloc(sizeof(PRINTER_INFO_1))) == NULL) |
3811 |
if((printer=SMB_MALLOC_P(PRINTER_INFO_1)) == NULL) |
| 3812 |
return WERR_NOMEM; |
3812 |
return WERR_NOMEM; |
| 3813 |
|
3813 |
|
| 3814 |
construct_printer_info_1(PRINTER_ENUM_ICON8, printer, snum); |
3814 |
construct_printer_info_1(PRINTER_ENUM_ICON8, printer, snum); |
|
Lines 3841-3847
Link Here
|
| 3841 |
{ |
3841 |
{ |
| 3842 |
PRINTER_INFO_2 *printer=NULL; |
3842 |
PRINTER_INFO_2 *printer=NULL; |
| 3843 |
|
3843 |
|
| 3844 |
if((printer=(PRINTER_INFO_2*)malloc(sizeof(PRINTER_INFO_2)))==NULL) |
3844 |
if((printer=SMB_MALLOC_P(PRINTER_INFO_2))==NULL) |
| 3845 |
return WERR_NOMEM; |
3845 |
return WERR_NOMEM; |
| 3846 |
|
3846 |
|
| 3847 |
construct_printer_info_2(printer, snum); |
3847 |
construct_printer_info_2(printer, snum); |
|
Lines 3908-3914
Link Here
|
| 3908 |
{ |
3908 |
{ |
| 3909 |
PRINTER_INFO_4 *printer=NULL; |
3909 |
PRINTER_INFO_4 *printer=NULL; |
| 3910 |
|
3910 |
|
| 3911 |
if((printer=(PRINTER_INFO_4*)malloc(sizeof(PRINTER_INFO_4)))==NULL) |
3911 |
if((printer=SMB_MALLOC_P(PRINTER_INFO_4))==NULL) |
| 3912 |
return WERR_NOMEM; |
3912 |
return WERR_NOMEM; |
| 3913 |
|
3913 |
|
| 3914 |
if (!construct_printer_info_4(printer, snum)) |
3914 |
if (!construct_printer_info_4(printer, snum)) |
|
Lines 3942-3948
Link Here
|
| 3942 |
{ |
3942 |
{ |
| 3943 |
PRINTER_INFO_5 *printer=NULL; |
3943 |
PRINTER_INFO_5 *printer=NULL; |
| 3944 |
|
3944 |
|
| 3945 |
if((printer=(PRINTER_INFO_5*)malloc(sizeof(PRINTER_INFO_5)))==NULL) |
3945 |
if((printer=SMB_MALLOC_P(PRINTER_INFO_5))==NULL) |
| 3946 |
return WERR_NOMEM; |
3946 |
return WERR_NOMEM; |
| 3947 |
|
3947 |
|
| 3948 |
if (!construct_printer_info_5(printer, snum)) |
3948 |
if (!construct_printer_info_5(printer, snum)) |
|
Lines 4128-4134
Link Here
|
| 4128 |
if (strlen(v) == 0) break; |
4128 |
if (strlen(v) == 0) break; |
| 4129 |
slprintf(line, sizeof(line)-1, "\\\\%s%s", servername, v); |
4129 |
slprintf(line, sizeof(line)-1, "\\\\%s%s", servername, v); |
| 4130 |
DEBUGADD(6,("%d:%s:%d\n", i, line, strlen(line))); |
4130 |
DEBUGADD(6,("%d:%s:%d\n", i, line, strlen(line))); |
| 4131 |
if((tuary=Realloc(*uni_array, (j+strlen(line)+2)*sizeof(uint16))) == NULL) { |
4131 |
if((tuary= SMB_REALLOC_ARRAY( *uni_array, uint16, j+strlen(line)+2 )) == NULL) { |
| 4132 |
DEBUG(2,("init_unistr_array: Realloc error\n" )); |
4132 |
DEBUG(2,("init_unistr_array: Realloc error\n" )); |
| 4133 |
return; |
4133 |
return; |
| 4134 |
} else |
4134 |
} else |
|
Lines 4385-4391
Link Here
|
| 4385 |
DRIVER_INFO_1 *info=NULL; |
4385 |
DRIVER_INFO_1 *info=NULL; |
| 4386 |
WERROR status; |
4386 |
WERROR status; |
| 4387 |
|
4387 |
|
| 4388 |
if((info=(DRIVER_INFO_1 *)malloc(sizeof(DRIVER_INFO_1))) == NULL) |
4388 |
if((info=SMB_MALLOC_P(DRIVER_INFO_1)) == NULL) |
| 4389 |
return WERR_NOMEM; |
4389 |
return WERR_NOMEM; |
| 4390 |
|
4390 |
|
| 4391 |
status=construct_printer_driver_info_1(info, snum, servername, architecture, version); |
4391 |
status=construct_printer_driver_info_1(info, snum, servername, architecture, version); |
|
Lines 4422-4428
Link Here
|
| 4422 |
DRIVER_INFO_2 *info=NULL; |
4422 |
DRIVER_INFO_2 *info=NULL; |
| 4423 |
WERROR status; |
4423 |
WERROR status; |
| 4424 |
|
4424 |
|
| 4425 |
if((info=(DRIVER_INFO_2 *)malloc(sizeof(DRIVER_INFO_2))) == NULL) |
4425 |
if((info=SMB_MALLOC_P(DRIVER_INFO_2)) == NULL) |
| 4426 |
return WERR_NOMEM; |
4426 |
return WERR_NOMEM; |
| 4427 |
|
4427 |
|
| 4428 |
status=construct_printer_driver_info_2(info, snum, servername, architecture, version); |
4428 |
status=construct_printer_driver_info_2(info, snum, servername, architecture, version); |
|
Lines 5541-5547
Link Here
|
| 5541 |
JOB_INFO_1 *info; |
5541 |
JOB_INFO_1 *info; |
| 5542 |
int i; |
5542 |
int i; |
| 5543 |
|
5543 |
|
| 5544 |
info=(JOB_INFO_1 *)malloc(*returned*sizeof(JOB_INFO_1)); |
5544 |
info=SMB_MALLOC_ARRAY(JOB_INFO_1, *returned); |
| 5545 |
if (info==NULL) { |
5545 |
if (info==NULL) { |
| 5546 |
SAFE_FREE(queue); |
5546 |
SAFE_FREE(queue); |
| 5547 |
*returned=0; |
5547 |
*returned=0; |
|
Lines 5591-5597
Link Here
|
| 5591 |
WERROR result; |
5591 |
WERROR result; |
| 5592 |
DEVICEMODE *devmode = NULL; |
5592 |
DEVICEMODE *devmode = NULL; |
| 5593 |
|
5593 |
|
| 5594 |
info=(JOB_INFO_2 *)malloc(*returned*sizeof(JOB_INFO_2)); |
5594 |
info=SMB_MALLOC_ARRAY(JOB_INFO_2, *returned ); |
| 5595 |
if (info==NULL) { |
5595 |
if (info==NULL) { |
| 5596 |
*returned=0; |
5596 |
*returned=0; |
| 5597 |
result = WERR_NOMEM; |
5597 |
result = WERR_NOMEM; |
|
Lines 5783-5789
Link Here
|
| 5783 |
return WERR_NOMEM; |
5783 |
return WERR_NOMEM; |
| 5784 |
|
5784 |
|
| 5785 |
if(ndrivers != 0) { |
5785 |
if(ndrivers != 0) { |
| 5786 |
if((tdi1=(DRIVER_INFO_1 *)Realloc(driver_info_1, (*returned+ndrivers) * sizeof(DRIVER_INFO_1))) == NULL) { |
5786 |
if((tdi1=SMB_REALLOC_ARRAY(driver_info_1, DRIVER_INFO_1, *returned+ndrivers )) == NULL) { |
| 5787 |
DEBUG(0,("enumprinterdrivers_level1: failed to enlarge driver info buffer!\n")); |
5787 |
DEBUG(0,("enumprinterdrivers_level1: failed to enlarge driver info buffer!\n")); |
| 5788 |
SAFE_FREE(driver_info_1); |
5788 |
SAFE_FREE(driver_info_1); |
| 5789 |
SAFE_FREE(list); |
5789 |
SAFE_FREE(list); |
|
Lines 5864-5870
Link Here
|
| 5864 |
return WERR_NOMEM; |
5864 |
return WERR_NOMEM; |
| 5865 |
|
5865 |
|
| 5866 |
if(ndrivers != 0) { |
5866 |
if(ndrivers != 0) { |
| 5867 |
if((tdi2=(DRIVER_INFO_2 *)Realloc(driver_info_2, (*returned+ndrivers) * sizeof(DRIVER_INFO_2))) == NULL) { |
5867 |
if((tdi2= SMB_REALLOC_ARRAY( driver_info_2, DRIVER_INFO_2, *returned+ndrivers )) == NULL) { |
| 5868 |
DEBUG(0,("enumprinterdrivers_level2: failed to enlarge driver info buffer!\n")); |
5868 |
DEBUG(0,("enumprinterdrivers_level2: failed to enlarge driver info buffer!\n")); |
| 5869 |
SAFE_FREE(driver_info_2); |
5869 |
SAFE_FREE(driver_info_2); |
| 5870 |
SAFE_FREE(list); |
5870 |
SAFE_FREE(list); |
|
Lines 5946-5952
Link Here
|
| 5946 |
return WERR_NOMEM; |
5946 |
return WERR_NOMEM; |
| 5947 |
|
5947 |
|
| 5948 |
if(ndrivers != 0) { |
5948 |
if(ndrivers != 0) { |
| 5949 |
if((tdi3=(DRIVER_INFO_3 *)Realloc(driver_info_3, (*returned+ndrivers) * sizeof(DRIVER_INFO_3))) == NULL) { |
5949 |
if((tdi3=SMB_REALLOC_ARRAY( driver_info_3, DRIVER_INFO_3, *returned+ndrivers )) == NULL) { |
| 5950 |
DEBUG(0,("enumprinterdrivers_level3: failed to enlarge driver info buffer!\n")); |
5950 |
DEBUG(0,("enumprinterdrivers_level3: failed to enlarge driver info buffer!\n")); |
| 5951 |
SAFE_FREE(driver_info_3); |
5951 |
SAFE_FREE(driver_info_3); |
| 5952 |
SAFE_FREE(list); |
5952 |
SAFE_FREE(list); |
|
Lines 6099-6105
Link Here
|
| 6099 |
|
6099 |
|
| 6100 |
switch (level) { |
6100 |
switch (level) { |
| 6101 |
case 1: |
6101 |
case 1: |
| 6102 |
if ((forms_1=(FORM_1 *)malloc(*numofforms * sizeof(FORM_1))) == NULL) { |
6102 |
if ((forms_1=SMB_MALLOC_ARRAY(FORM_1, *numofforms)) == NULL) { |
| 6103 |
*numofforms=0; |
6103 |
*numofforms=0; |
| 6104 |
return WERR_NOMEM; |
6104 |
return WERR_NOMEM; |
| 6105 |
} |
6105 |
} |
|
Lines 6305-6311
Link Here
|
| 6305 |
close(fd); |
6305 |
close(fd); |
| 6306 |
|
6306 |
|
| 6307 |
if(numlines) { |
6307 |
if(numlines) { |
| 6308 |
if((ports=(PORT_INFO_1 *)malloc( numlines * sizeof(PORT_INFO_1) )) == NULL) { |
6308 |
if((ports=SMB_MALLOC_ARRAY( PORT_INFO_1, numlines )) == NULL) { |
| 6309 |
DEBUG(10,("Returning WERR_NOMEM [%s]\n", |
6309 |
DEBUG(10,("Returning WERR_NOMEM [%s]\n", |
| 6310 |
dos_errstr(WERR_NOMEM))); |
6310 |
dos_errstr(WERR_NOMEM))); |
| 6311 |
file_lines_free(qlines); |
6311 |
file_lines_free(qlines); |
|
Lines 6325-6331
Link Here
|
| 6325 |
} else { |
6325 |
} else { |
| 6326 |
*returned = 1; /* Sole Samba port returned. */ |
6326 |
*returned = 1; /* Sole Samba port returned. */ |
| 6327 |
|
6327 |
|
| 6328 |
if((ports=(PORT_INFO_1 *)malloc( sizeof(PORT_INFO_1) )) == NULL) |
6328 |
if((ports=SMB_MALLOC_P(PORT_INFO_1)) == NULL) |
| 6329 |
return WERR_NOMEM; |
6329 |
return WERR_NOMEM; |
| 6330 |
|
6330 |
|
| 6331 |
DEBUG(10,("enumports_level_1: port name %s\n", SAMBA_PRINTER_PORT_NAME)); |
6331 |
DEBUG(10,("enumports_level_1: port name %s\n", SAMBA_PRINTER_PORT_NAME)); |
|
Lines 6404-6410
Link Here
|
| 6404 |
close(fd); |
6404 |
close(fd); |
| 6405 |
|
6405 |
|
| 6406 |
if(numlines) { |
6406 |
if(numlines) { |
| 6407 |
if((ports=(PORT_INFO_2 *)malloc( numlines * sizeof(PORT_INFO_2) )) == NULL) { |
6407 |
if((ports=SMB_MALLOC_ARRAY( PORT_INFO_2, numlines )) == NULL) { |
| 6408 |
file_lines_free(qlines); |
6408 |
file_lines_free(qlines); |
| 6409 |
return WERR_NOMEM; |
6409 |
return WERR_NOMEM; |
| 6410 |
} |
6410 |
} |
|
Lines 6423-6429
Link Here
|
| 6423 |
|
6423 |
|
| 6424 |
*returned = 1; |
6424 |
*returned = 1; |
| 6425 |
|
6425 |
|
| 6426 |
if((ports=(PORT_INFO_2 *)malloc( sizeof(PORT_INFO_2) )) == NULL) |
6426 |
if((ports=SMB_MALLOC_P(PORT_INFO_2)) == NULL) |
| 6427 |
return WERR_NOMEM; |
6427 |
return WERR_NOMEM; |
| 6428 |
|
6428 |
|
| 6429 |
DEBUG(10,("enumports_level_2: port name %s\n", SAMBA_PRINTER_PORT_NAME)); |
6429 |
DEBUG(10,("enumports_level_2: port name %s\n", SAMBA_PRINTER_PORT_NAME)); |
|
Lines 6504-6510
Link Here
|
| 6504 |
int snum; |
6504 |
int snum; |
| 6505 |
WERROR err = WERR_OK; |
6505 |
WERROR err = WERR_OK; |
| 6506 |
|
6506 |
|
| 6507 |
if ((printer = (NT_PRINTER_INFO_LEVEL *)malloc(sizeof(NT_PRINTER_INFO_LEVEL))) == NULL) { |
6507 |
if ((printer = SMB_MALLOC_P(NT_PRINTER_INFO_LEVEL)) == NULL) { |
| 6508 |
DEBUG(0,("spoolss_addprinterex_level_2: malloc fail.\n")); |
6508 |
DEBUG(0,("spoolss_addprinterex_level_2: malloc fail.\n")); |
| 6509 |
return WERR_NOMEM; |
6509 |
return WERR_NOMEM; |
| 6510 |
} |
6510 |
} |
|
Lines 6787-6793
Link Here
|
| 6787 |
if (get_short_archi(short_archi, long_archi)==False) |
6787 |
if (get_short_archi(short_archi, long_archi)==False) |
| 6788 |
return WERR_INVALID_ENVIRONMENT; |
6788 |
return WERR_INVALID_ENVIRONMENT; |
| 6789 |
|
6789 |
|
| 6790 |
if((info=(DRIVER_DIRECTORY_1 *)malloc(sizeof(DRIVER_DIRECTORY_1))) == NULL) |
6790 |
if((info=SMB_MALLOC_P(DRIVER_DIRECTORY_1)) == NULL) |
| 6791 |
return WERR_NOMEM; |
6791 |
return WERR_NOMEM; |
| 6792 |
|
6792 |
|
| 6793 |
slprintf(path, sizeof(path)-1, "\\\\%s\\print$\\%s", get_called_name(), short_archi); |
6793 |
slprintf(path, sizeof(path)-1, "\\\\%s\\print$\\%s", get_called_name(), short_archi); |
|
Lines 6942-6948
Link Here
|
| 6942 |
problems unmarshalling the response */ |
6942 |
problems unmarshalling the response */ |
| 6943 |
|
6943 |
|
| 6944 |
*out_max_value_len=(in_value_len/sizeof(uint16)); |
6944 |
*out_max_value_len=(in_value_len/sizeof(uint16)); |
| 6945 |
if((*out_value=(uint16 *)talloc_zero(p->mem_ctx, in_value_len*sizeof(uint8))) == NULL) |
6945 |
if((*out_value=(uint16 *)TALLOC_ZERO(p->mem_ctx, in_value_len*sizeof(uint8))) == NULL) |
| 6946 |
return WERR_NOMEM; |
6946 |
return WERR_NOMEM; |
| 6947 |
|
6947 |
|
| 6948 |
*out_value_len = (uint32)dos_PutUniCode((char *)*out_value, "", in_value_len, True); |
6948 |
*out_value_len = (uint32)dos_PutUniCode((char *)*out_value, "", in_value_len, True); |
|
Lines 6950-6956
Link Here
|
| 6950 |
/* the data is counted in bytes */ |
6950 |
/* the data is counted in bytes */ |
| 6951 |
*out_max_data_len = in_data_len; |
6951 |
*out_max_data_len = in_data_len; |
| 6952 |
*out_data_len = in_data_len; |
6952 |
*out_data_len = in_data_len; |
| 6953 |
if((*data_out=(uint8 *)talloc_zero(p->mem_ctx, in_data_len*sizeof(uint8))) == NULL) |
6953 |
if((*data_out=(uint8 *)TALLOC_ZERO(p->mem_ctx, in_data_len*sizeof(uint8))) == NULL) |
| 6954 |
return WERR_NOMEM; |
6954 |
return WERR_NOMEM; |
| 6955 |
|
6955 |
|
| 6956 |
return WERR_NO_MORE_ITEMS; |
6956 |
return WERR_NO_MORE_ITEMS; |
|
Lines 6968-6974
Link Here
|
| 6968 |
*/ |
6968 |
*/ |
| 6969 |
|
6969 |
|
| 6970 |
*out_max_value_len=(in_value_len/sizeof(uint16)); |
6970 |
*out_max_value_len=(in_value_len/sizeof(uint16)); |
| 6971 |
if((*out_value=(uint16 *)talloc_zero(p->mem_ctx,in_value_len*sizeof(uint8))) == NULL) { |
6971 |
if((*out_value=(uint16 *)TALLOC_ZERO(p->mem_ctx,in_value_len*sizeof(uint8))) == NULL) { |
| 6972 |
SAFE_FREE(data); |
6972 |
SAFE_FREE(data); |
| 6973 |
return WERR_NOMEM; |
6973 |
return WERR_NOMEM; |
| 6974 |
} |
6974 |
} |
|
Lines 6979-6985
Link Here
|
| 6979 |
|
6979 |
|
| 6980 |
/* the data is counted in bytes */ |
6980 |
/* the data is counted in bytes */ |
| 6981 |
*out_max_data_len=in_data_len; |
6981 |
*out_max_data_len=in_data_len; |
| 6982 |
if((*data_out=(uint8 *)talloc_zero(p->mem_ctx, in_data_len*sizeof(uint8))) == NULL) { |
6982 |
if((*data_out=(uint8 *)TALLOC_ZERO(p->mem_ctx, in_data_len*sizeof(uint8))) == NULL) { |
| 6983 |
SAFE_FREE(data); |
6983 |
SAFE_FREE(data); |
| 6984 |
return WERR_NOMEM; |
6984 |
return WERR_NOMEM; |
| 6985 |
} |
6985 |
} |
|
Lines 7366-7372
Link Here
|
| 7366 |
{ |
7366 |
{ |
| 7367 |
PRINTPROCESSOR_1 *info_1=NULL; |
7367 |
PRINTPROCESSOR_1 *info_1=NULL; |
| 7368 |
|
7368 |
|
| 7369 |
if((info_1 = (PRINTPROCESSOR_1 *)malloc(sizeof(PRINTPROCESSOR_1))) == NULL) |
7369 |
if((info_1 = SMB_MALLOC_P(PRINTPROCESSOR_1)) == NULL) |
| 7370 |
return WERR_NOMEM; |
7370 |
return WERR_NOMEM; |
| 7371 |
|
7371 |
|
| 7372 |
(*returned) = 0x1; |
7372 |
(*returned) = 0x1; |
|
Lines 7435-7441
Link Here
|
| 7435 |
{ |
7435 |
{ |
| 7436 |
PRINTPROCDATATYPE_1 *info_1=NULL; |
7436 |
PRINTPROCDATATYPE_1 *info_1=NULL; |
| 7437 |
|
7437 |
|
| 7438 |
if((info_1 = (PRINTPROCDATATYPE_1 *)malloc(sizeof(PRINTPROCDATATYPE_1))) == NULL) |
7438 |
if((info_1 = SMB_MALLOC_P(PRINTPROCDATATYPE_1)) == NULL) |
| 7439 |
return WERR_NOMEM; |
7439 |
return WERR_NOMEM; |
| 7440 |
|
7440 |
|
| 7441 |
(*returned) = 0x1; |
7441 |
(*returned) = 0x1; |
|
Lines 7497-7503
Link Here
|
| 7497 |
{ |
7497 |
{ |
| 7498 |
PRINTMONITOR_1 *info_1=NULL; |
7498 |
PRINTMONITOR_1 *info_1=NULL; |
| 7499 |
|
7499 |
|
| 7500 |
if((info_1 = (PRINTMONITOR_1 *)malloc(sizeof(PRINTMONITOR_1))) == NULL) |
7500 |
if((info_1 = SMB_MALLOC_P(PRINTMONITOR_1)) == NULL) |
| 7501 |
return WERR_NOMEM; |
7501 |
return WERR_NOMEM; |
| 7502 |
|
7502 |
|
| 7503 |
(*returned) = 0x1; |
7503 |
(*returned) = 0x1; |
|
Lines 7529-7535
Link Here
|
| 7529 |
{ |
7529 |
{ |
| 7530 |
PRINTMONITOR_2 *info_2=NULL; |
7530 |
PRINTMONITOR_2 *info_2=NULL; |
| 7531 |
|
7531 |
|
| 7532 |
if((info_2 = (PRINTMONITOR_2 *)malloc(sizeof(PRINTMONITOR_2))) == NULL) |
7532 |
if((info_2 = SMB_MALLOC_P(PRINTMONITOR_2)) == NULL) |
| 7533 |
return WERR_NOMEM; |
7533 |
return WERR_NOMEM; |
| 7534 |
|
7534 |
|
| 7535 |
(*returned) = 0x1; |
7535 |
(*returned) = 0x1; |
|
Lines 7602-7608
Link Here
|
| 7602 |
BOOL found=False; |
7602 |
BOOL found=False; |
| 7603 |
JOB_INFO_1 *info_1=NULL; |
7603 |
JOB_INFO_1 *info_1=NULL; |
| 7604 |
|
7604 |
|
| 7605 |
info_1=(JOB_INFO_1 *)malloc(sizeof(JOB_INFO_1)); |
7605 |
info_1=SMB_MALLOC_P(JOB_INFO_1); |
| 7606 |
|
7606 |
|
| 7607 |
if (info_1 == NULL) { |
7607 |
if (info_1 == NULL) { |
| 7608 |
SAFE_FREE(queue); |
7608 |
SAFE_FREE(queue); |
|
Lines 7654-7660
Link Here
|
| 7654 |
WERROR ret; |
7654 |
WERROR ret; |
| 7655 |
DEVICEMODE *devmode = NULL; |
7655 |
DEVICEMODE *devmode = NULL; |
| 7656 |
|
7656 |
|
| 7657 |
info_2=(JOB_INFO_2 *)malloc(sizeof(JOB_INFO_2)); |
7657 |
info_2=SMB_MALLOC_P(JOB_INFO_2); |
| 7658 |
|
7658 |
|
| 7659 |
ZERO_STRUCTP(info_2); |
7659 |
ZERO_STRUCTP(info_2); |
| 7660 |
|
7660 |
|
|
Lines 7785-7791
Link Here
|
| 7785 |
|
7785 |
|
| 7786 |
|
7786 |
|
| 7787 |
if (!Printer) { |
7787 |
if (!Printer) { |
| 7788 |
if((*data=(uint8 *)talloc_zero(p->mem_ctx, 4*sizeof(uint8))) == NULL) |
7788 |
if((*data=(uint8 *)TALLOC_ZERO(p->mem_ctx, 4*sizeof(uint8))) == NULL) |
| 7789 |
return WERR_NOMEM; |
7789 |
return WERR_NOMEM; |
| 7790 |
DEBUG(2,("_spoolss_getprinterdata: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle))); |
7790 |
DEBUG(2,("_spoolss_getprinterdata: Invalid handle (%s:%u:%u).\n", OUR_HANDLE(handle))); |
| 7791 |
return WERR_BADFID; |
7791 |
return WERR_BADFID; |
|
Lines 7824-7830
Link Here
|
| 7824 |
|
7824 |
|
| 7825 |
/* reply this param doesn't exist */ |
7825 |
/* reply this param doesn't exist */ |
| 7826 |
if (*out_size) { |
7826 |
if (*out_size) { |
| 7827 |
if((*data=(uint8 *)talloc_zero(p->mem_ctx, *out_size*sizeof(uint8))) == NULL) |
7827 |
if((*data=TALLOC_ZERO_ARRAY(p->mem_ctx, uint8, *out_size)) == NULL) |
| 7828 |
return WERR_NOMEM; |
7828 |
return WERR_NOMEM; |
| 7829 |
} else { |
7829 |
} else { |
| 7830 |
*data = NULL; |
7830 |
*data = NULL; |
|
Lines 8008-8014
Link Here
|
| 8008 |
|
8008 |
|
| 8009 |
DEBUG(10,("retrieved value number [%d] [%s]\n", num_entries, value)); |
8009 |
DEBUG(10,("retrieved value number [%d] [%s]\n", num_entries, value)); |
| 8010 |
|
8010 |
|
| 8011 |
if ((ptr=talloc_realloc(p->mem_ctx, enum_values, (num_entries+1) * sizeof(PRINTER_ENUM_VALUES))) == NULL) |
8011 |
if ((ptr=TALLOC_REALLOC_ARRAY(p->mem_ctx, enum_values, PRINTER_ENUM_VALUES, num_entries+1)) == NULL) |
| 8012 |
{ |
8012 |
{ |
| 8013 |
DEBUG(0,("talloc_realloc failed to allocate more memory!\n")); |
8013 |
DEBUG(0,("talloc_realloc failed to allocate more memory!\n")); |
| 8014 |
result = WERR_NOMEM; |
8014 |
result = WERR_NOMEM; |
|
Lines 8026-8032
Link Here
|
| 8026 |
|
8026 |
|
| 8027 |
if ( data_len ) |
8027 |
if ( data_len ) |
| 8028 |
{ |
8028 |
{ |
| 8029 |
if ( !(enum_values[num_entries].data = talloc_zero(p->mem_ctx, data_len)) ) { |
8029 |
if ( !(enum_values[num_entries].data = TALLOC_ZERO(p->mem_ctx, data_len)) ) { |
| 8030 |
DEBUG(0,("talloc_realloc failed to allocate more memory [data_len=%d] for data!\n", data_len )); |
8030 |
DEBUG(0,("talloc_realloc failed to allocate more memory [data_len=%d] for data!\n", data_len )); |
| 8031 |
result = WERR_NOMEM; |
8031 |
result = WERR_NOMEM; |
| 8032 |
goto done; |
8032 |
goto done; |
|
Lines 8090-8096
Link Here
|
| 8090 |
if (get_short_archi(short_archi, long_archi)==False) |
8090 |
if (get_short_archi(short_archi, long_archi)==False) |
| 8091 |
return WERR_INVALID_ENVIRONMENT; |
8091 |
return WERR_INVALID_ENVIRONMENT; |
| 8092 |
|
8092 |
|
| 8093 |
if((info=(PRINTPROCESSOR_DIRECTORY_1 *)malloc(sizeof(PRINTPROCESSOR_DIRECTORY_1))) == NULL) |
8093 |
if((info=SMB_MALLOC_P(PRINTPROCESSOR_DIRECTORY_1)) == NULL) |
| 8094 |
return WERR_NOMEM; |
8094 |
return WERR_NOMEM; |
| 8095 |
|
8095 |
|
| 8096 |
pstrcpy(path, "C:\\WINNT\\System32\\spool\\PRTPROCS\\W32X86"); |
8096 |
pstrcpy(path, "C:\\WINNT\\System32\\spool\\PRTPROCS\\W32X86"); |