These were reported when compiling with "-fsanitize=address" and running
"PYTHONMALLOC=malloc make check":
=================================================================
==42879==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 317 byte(s) in 6 object(s) allocated from:
#0 0x7f08e4809538 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
#1 0x7f08e3f37622 in PyUnicode_New ../Objects/unicodeobject.c:1365
Direct leak of 28 byte(s) in 1 object(s) allocated from:
#0 0x7f08e4809538 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
#1 0x7f08e3f7e1a5 in _PyLong_New ../Objects/longobject.c:275
Direct leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x7f08e4809538 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
#1 0x7f08e3f91521 in PyFloat_FromDouble ../Objects/floatobject.c:122
SUMMARY: AddressSanitizer: 369 byte(s) leaked in 8 allocation(s).
session
goto err_out;
}
}
- if (PyDict_SetItemString(py_di_options, sdo->id, py_optval) == -1)
+ if (PyDict_SetItemString(py_di_options, sdo->id, py_optval) == -1) {
+ Py_XDECREF(py_optval);
goto err_out;
+ }
/* Not harmful even if we used the default. */
g_hash_table_remove(options, sdo->id);
+ Py_XDECREF(py_optval);
}
if (g_hash_table_size(options) != 0)
srd_warn("Unknown options specified for '%s'", di->inst_id);
ret = SRD_OK;
err_out:
- Py_XDECREF(py_optval);
if (PyErr_Occurred()) {
srd_exception_catch("Stray exception in srd_inst_option_set()");
ret = SRD_ERR_PYTHON;