summaryrefslogtreecommitdiff
path: root/source3/python
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-05-09 12:43:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:50 -0500
commit3c181a88c6c03cde3d6abb917c656bbe6be8a130 (patch)
tree25959680a7e24eb8f9856c7735c597dfcb264157 /source3/python
parent08355754151b2d02b2102bc76e94b63ffffdf408 (diff)
downloadsamba-3c181a88c6c03cde3d6abb917c656bbe6be8a130.tar.gz
samba-3c181a88c6c03cde3d6abb917c656bbe6be8a130.tar.bz2
samba-3c181a88c6c03cde3d6abb917c656bbe6be8a130.zip
r6678: fix python python after talloc() shakeup
(This used to be commit f629bffb1a6b8c2ea54fcfe33865b43559abbc77)
Diffstat (limited to 'source3/python')
-rw-r--r--source3/python/py_lsa.c8
-rw-r--r--source3/python/py_ntsec.c2
-rw-r--r--source3/python/py_smb.c2
-rw-r--r--source3/python/py_spoolss_drivers_conv.c2
-rw-r--r--source3/python/py_spoolss_printers.c2
-rw-r--r--source3/python/py_spoolss_printers_conv.c2
-rw-r--r--source3/python/py_srvsvc.c2
-rw-r--r--source3/python/py_tdb.c4
-rw-r--r--source3/python/py_tdbpack.c3
9 files changed, 14 insertions, 13 deletions
diff --git a/source3/python/py_lsa.c b/source3/python/py_lsa.c
index aab526a489..bf9d466185 100644
--- a/source3/python/py_lsa.c
+++ b/source3/python/py_lsa.c
@@ -167,7 +167,7 @@ static PyObject *lsa_lookup_names(PyObject *self, PyObject *args)
/* Convert list to char ** array */
num_names = PyList_Size(py_names);
- names = (const char **)talloc(mem_ctx, num_names * sizeof(char *));
+ names = (const char **)_talloc(mem_ctx, num_names * sizeof(char *));
for (i = 0; i < num_names; i++) {
PyObject *obj = PyList_GetItem(py_names, i);
@@ -180,7 +180,7 @@ static PyObject *lsa_lookup_names(PyObject *self, PyObject *args)
/* Just a single element */
num_names = 1;
- names = (const char **)talloc(mem_ctx, sizeof(char *));
+ names = (const char **)_talloc(mem_ctx, sizeof(char *));
names[0] = PyString_AsString(py_names);
}
@@ -241,7 +241,7 @@ static PyObject *lsa_lookup_sids(PyObject *self, PyObject *args,
/* Convert dictionary to char ** array */
num_sids = PyList_Size(py_sids);
- sids = (DOM_SID *)talloc(mem_ctx, num_sids * sizeof(DOM_SID));
+ sids = (DOM_SID *)_talloc(mem_ctx, num_sids * sizeof(DOM_SID));
memset(sids, 0, num_sids * sizeof(DOM_SID));
@@ -259,7 +259,7 @@ static PyObject *lsa_lookup_sids(PyObject *self, PyObject *args,
/* Just a single element */
num_sids = 1;
- sids = (DOM_SID *)talloc(mem_ctx, sizeof(DOM_SID));
+ sids = (DOM_SID *)_talloc(mem_ctx, sizeof(DOM_SID));
if (!string_to_sid(&sids[0], PyString_AsString(py_sids))) {
PyErr_SetString(PyExc_ValueError, "string_to_sid failed");
diff --git a/source3/python/py_ntsec.c b/source3/python/py_ntsec.c
index 907e9d08c1..38886f679e 100644
--- a/source3/python/py_ntsec.c
+++ b/source3/python/py_ntsec.c
@@ -157,7 +157,7 @@ BOOL py_to_ACL(SEC_ACL *acl, PyObject *dict, TALLOC_CTX *mem_ctx)
acl->num_aces = PyList_Size(obj);
- acl->ace = talloc(mem_ctx, acl->num_aces * sizeof(SEC_ACE));
+ acl->ace = _talloc(mem_ctx, acl->num_aces * sizeof(SEC_ACE));
acl->size = SEC_ACL_HEADER_SIZE;
for (i = 0; i < acl->num_aces; i++) {
diff --git a/source3/python/py_smb.c b/source3/python/py_smb.c
index ad83e469b2..d3858d33d8 100644
--- a/source3/python/py_smb.c
+++ b/source3/python/py_smb.c
@@ -235,7 +235,7 @@ static PyObject *py_smb_read(PyObject *self, PyObject *args, PyObject *kw)
if (size < 1 || size > fsize - offset)
size = fsize - offset;
- if (!(data = (char *) malloc((size_t) size))) {
+ if (!(data = SMB_XMALLOC_ARRAY(char, size))) {
PyErr_SetString(PyExc_RuntimeError, "malloc failed");
return NULL;
}
diff --git a/source3/python/py_spoolss_drivers_conv.c b/source3/python/py_spoolss_drivers_conv.c
index ae196c1903..8ad6d88493 100644
--- a/source3/python/py_spoolss_drivers_conv.c
+++ b/source3/python/py_spoolss_drivers_conv.c
@@ -99,7 +99,7 @@ static uint16 *to_dependentfiles(PyObject *list, TALLOC_CTX *mem_ctx)
size+=PyString_Size(borrowedRef)+1;
}
- if (!(ret = (uint16*) talloc(mem_ctx,(size+1)*sizeof(uint16))))
+ if (!(ret = (uint16*)_talloc(mem_ctx,((size+1)*sizeof(uint16)))))
goto done;
/* create null terminated sequence of null terminated strings */
diff --git a/source3/python/py_spoolss_printers.c b/source3/python/py_spoolss_printers.c
index d011681acc..a8efda1601 100644
--- a/source3/python/py_spoolss_printers.c
+++ b/source3/python/py_spoolss_printers.c
@@ -43,7 +43,7 @@ PyObject *spoolss_openprinter(PyObject *self, PyObject *args, PyObject *kw)
return NULL;
}
- server = strdup(unc_name + 2);
+ server = SMB_XSTRDUP(unc_name + 2);
if (strchr(server, '\\')) {
char *c = strchr(server, '\\');
diff --git a/source3/python/py_spoolss_printers_conv.c b/source3/python/py_spoolss_printers_conv.c
index f7b2f516df..e31babb001 100644
--- a/source3/python/py_spoolss_printers_conv.c
+++ b/source3/python/py_spoolss_printers_conv.c
@@ -291,7 +291,7 @@ BOOL py_to_PRINTER_INFO_2(PRINTER_INFO_2 *info, PyObject *dict,
|| !PyDict_Check(obj))
goto done;
- info->devmode = talloc(mem_ctx, sizeof(DEVICEMODE));
+ info->devmode = _talloc(mem_ctx, sizeof(DEVICEMODE));
if (!py_to_DEVICEMODE(info->devmode, obj))
goto done;
diff --git a/source3/python/py_srvsvc.c b/source3/python/py_srvsvc.c
index 3e5a42be23..1fa7ca89c2 100644
--- a/source3/python/py_srvsvc.c
+++ b/source3/python/py_srvsvc.c
@@ -93,7 +93,7 @@ PyObject *srvsvc_netservergetinfo(PyObject *self, PyObject *args,
return NULL;
}
- server = strdup(unc_name + 2);
+ server = SMB_XSTRDUP(unc_name + 2);
if (strchr(server, '\\')) {
char *c = strchr(server, '\\');
diff --git a/source3/python/py_tdb.c b/source3/python/py_tdb.c
index 6796469759..ccd1e6e1c6 100644
--- a/source3/python/py_tdb.c
+++ b/source3/python/py_tdb.c
@@ -348,7 +348,7 @@ static BOOL make_lock_list(PyObject *py_keys, TDB_DATA **keys, int *num_keys)
/* Turn python list into array of keys */
*num_keys = PyList_Size(py_keys);
- *keys = (TDB_DATA *)malloc(sizeof(TDB_DATA) * (*num_keys));
+ *keys = (TDB_DATA *)SMB_XMALLOC_ARRAY(TDB_DATA, (*num_keys));
for (i = 0; i < *num_keys; i++) {
PyObject *key = PyList_GetItem(py_keys, i);
@@ -368,7 +368,7 @@ static BOOL make_lock_list(PyObject *py_keys, TDB_DATA **keys, int *num_keys)
/* Turn python string into a single key */
- *keys = (TDB_DATA *)malloc(sizeof(TDB_DATA));
+ *keys = (TDB_DATA *)SMB_XMALLOC_P(TDB_DATA);
*num_keys = 1;
PyArg_Parse(py_keys, "s#", &(*keys)->dptr, &(*keys)->dsize);
}
diff --git a/source3/python/py_tdbpack.c b/source3/python/py_tdbpack.c
index 4fa97af8a3..a71ce7cf4e 100644
--- a/source3/python/py_tdbpack.c
+++ b/source3/python/py_tdbpack.c
@@ -441,13 +441,14 @@ static void pack_le_uint32(unsigned long val_long, unsigned char *pbuf)
}
+#if 0 /* not used */
static void pack_bytes(long len, const char *from,
unsigned char **pbuf)
{
memcpy(*pbuf, from, len);
(*pbuf) += len;
}
-
+#endif
static PyObject *