search for: pyexc_memoryerror

Displaying 4 results from an estimated 4 matches for "pyexc_memoryerror".

Did you mean: _pyexc_memoryerror
2017 May 11
1
[PATCH] python: improve few exceptions thrown on error
..., strerror (errno)); + PyErr_SetFromErrno (PyExc_RuntimeError); return NULL; } @@ -271,7 +271,7 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn) /* Copy them into the return array. */ r = malloc (sizeof (PyObject *) * (*len_rtn)); if (r == NULL) { - PyErr_SetNone (PyExc_MemoryError); + PyErr_NoMemory (); return NULL; } @@ -298,7 +298,7 @@ guestfs_int_py_get_string_list (PyObject *obj) assert (obj); if (!PyList_Check (obj)) { - PyErr_SetString (PyExc_RuntimeError, "expecting a list parameter"); + PyErr_SetString (PyExc_TypeError, "expe...
2010 Sep 09
2
[PATCH]: add libxl python binding
...h" /* gah */ +#include "%s" + +int genwrap__string_set(PyObject *v, char **str) +{ + char *tmp; + if ( NULL == v ) { + free(*str); + *str = NULL; + return 0; + } + tmp = strdup(PyString_AsString(v)); + if ( NULL == tmp ) { + PyErr_SetString(PyExc_MemoryError, "Allocating device_net2.bridge attribute"); + return -1; + } + free(*str); + *str = tmp; + return 0; +} + +PyObject *genwrap__string_get(char **str) +{ + if ( NULL == *str ) + return Py_None; + return PyString_FromString(*str); +} + +PyObject *genwrap__ull...
2017 Mar 03
14
[PATCH 00/11] Various Coverity fixes
Hi, this patch series fixes some issues discovered by Coverity. Most of them are memory leaks, usually on error; there are also invalid memory access issues. Thanks, Pino Toscano (11): java: link libguestfs_jni against libutils java: fix invalid memory access for FBuffer in struct lists daemon: tsk: properly use GUESTFS_MAX_CHUNK_SIZE edit: fix small memory leak on error java: fix
2016 Feb 05
7
[PATCH 0/7] lib: Stop exporting the safe_malloc, etc. functions.
The safe_malloc (etc) functions call g->abort_fn on failure. That's not appropriate for language bindings, and we never intended that these internal functions be used from language bindings, that was just a historical accident. This patch series removes any external use of the safe_* functions. Rich.