mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
python: Stop using the safe_malloc, etc. functions.
This commit is contained in:
@@ -75,6 +75,8 @@ guestfs_int_py_close (PyObject *self, PyObject *args)
|
||||
* in a double-free here. XXX
|
||||
*/
|
||||
callbacks = get_all_event_callbacks (g, &len);
|
||||
if (callbacks == NULL)
|
||||
return NULL;
|
||||
|
||||
if (PyEval_ThreadsInitialized ())
|
||||
py_save = PyEval_SaveThread ();
|
||||
@@ -251,7 +253,11 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
|
||||
}
|
||||
|
||||
/* Copy them into the return array. */
|
||||
r = guestfs_int_safe_malloc (g, sizeof (PyObject *) * (*len_rtn));
|
||||
r = malloc (sizeof (PyObject *) * (*len_rtn));
|
||||
if (r == NULL) {
|
||||
PyErr_SetNone (PyExc_MemoryError);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
cb = guestfs_first_private (g, &key);
|
||||
|
||||
Reference in New Issue
Block a user