babeltrace-1.5.11-15.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:724:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘iter’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:8240:22: enter_function: entry to ‘_wrap__bt_ctf_writer_create’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:8250:6: branch_false: following ‘false’ branch (when ‘args’ is non-NULL)...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:8252:10: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:8252:10: call_function: calling ‘SWIG_AsCharPtrAndSize’ from ‘_wrap__bt_ctf_writer_create’
#  722|     swig_module_info *iter = start;
#  723|     do {
#  724|->     if (iter->size) {
#  725|         size_t l = 0;
#  726|         size_t r = iter->size - 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:1452:39: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5267:22: enter_function: entry to ‘_wrap_new_bt_iter_pos_u’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘_wrap_new_bt_iter_pos_u’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:8: return_function: returning to ‘_wrap_new_bt_iter_pos_u’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5273:29: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5273:29: acquire_memory: allocated here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5274:15: call_function: calling ‘SWIG_Python_NewPointerObj’ from ‘_wrap_new_bt_iter_pos_u’
# 1450|       /* free-threading note: the GIL is always enabled when this function is first called
# 1451|          by SWIG_init, so there's no risk of race conditions */
# 1452|->     Swig_runtime_data_module_global = PyImport_AddModuleRef(SWIG_RUNTIME_MODULE);
# 1453|   #elif PY_VERSION_HEX >= 0x03000000
# 1454|       Swig_runtime_data_module_global = PyImport_AddModule(SWIG_RUNTIME_MODULE);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def3]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:1901:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5304:22: enter_function: entry to ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: return_function: returning to ‘bt_iter_pos_u_swigregister’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:3: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:52: call_function: calling ‘SwigPyClientData_New’ from ‘bt_iter_pos_u_swigregister’
# 1899|       SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
# 1900|       /* the klass element */
# 1901|->     data->klass = obj;
# 1902|       SWIG_Py_INCREF(data->klass);
# 1903|       /* the newraw method and newargs arguments used to create a new raw instance */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:1904:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5304:22: enter_function: entry to ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: return_function: returning to ‘bt_iter_pos_u_swigregister’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:3: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:52: call_function: calling ‘SwigPyClientData_New’ from ‘bt_iter_pos_u_swigregister’
# 1902|       SWIG_Py_INCREF(data->klass);
# 1903|       /* the newraw method and newargs arguments used to create a new raw instance */
# 1904|->     if (PyClass_Check(obj)) {
# 1905|         data->newraw = 0;
# 1906|         SWIG_Py_INCREF(obj);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:1909:22: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5304:22: enter_function: entry to ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: return_function: returning to ‘bt_iter_pos_u_swigregister’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:3: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:52: call_function: calling ‘SwigPyClientData_New’ from ‘bt_iter_pos_u_swigregister’
# 1907|         data->newargs = obj;
# 1908|       } else {
# 1909|->       data->newraw = PyObject_GetAttrString(data->klass, "__new__");
# 1910|         if (data->newraw) {
# 1911|           data->newargs = PyTuple_New(1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:1911:25: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5304:22: enter_function: entry to ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: return_function: returning to ‘bt_iter_pos_u_swigregister’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:3: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:52: call_function: calling ‘SwigPyClientData_New’ from ‘bt_iter_pos_u_swigregister’
# 1909|         data->newraw = PyObject_GetAttrString(data->klass, "__new__");
# 1910|         if (data->newraw) {
# 1911|->         data->newargs = PyTuple_New(1);
# 1912|           if (data->newargs) {
# 1913|             SWIG_Py_INCREF(obj);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:1927:21: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5304:22: enter_function: entry to ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: return_function: returning to ‘bt_iter_pos_u_swigregister’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:3: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:52: call_function: calling ‘SwigPyClientData_New’ from ‘bt_iter_pos_u_swigregister’
# 1925|       }
# 1926|       /* the destroy method, aka as the C++ delete method */
# 1927|->     data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
# 1928|       if (PyErr_Occurred()) {
# 1929|         PyErr_Clear();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:1928:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5304:22: enter_function: entry to ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: return_function: returning to ‘bt_iter_pos_u_swigregister’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:3: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:52: call_function: calling ‘SwigPyClientData_New’ from ‘bt_iter_pos_u_swigregister’
# 1926|       /* the destroy method, aka as the C++ delete method */
# 1927|       data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
# 1928|->     if (PyErr_Occurred()) {
# 1929|         PyErr_Clear();
# 1930|         data->destroy = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:1929:7: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5304:22: enter_function: entry to ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘bt_iter_pos_u_swigregister’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:8: return_function: returning to ‘bt_iter_pos_u_swigregister’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5306:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:3: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5307:52: call_function: calling ‘SwigPyClientData_New’ from ‘bt_iter_pos_u_swigregister’
# 1927|       data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
# 1928|       if (PyErr_Occurred()) {
# 1929|->       PyErr_Clear();
# 1930|         data->destroy = 0;
# 1931|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:2440:22: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5267:22: enter_function: entry to ‘_wrap_new_bt_iter_pos_u’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘_wrap_new_bt_iter_pos_u’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:8: return_function: returning to ‘_wrap_new_bt_iter_pos_u’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5273:29: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5273:29: acquire_memory: allocated here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5274:15: call_function: calling ‘SWIG_Python_NewPointerObj’ from ‘_wrap_new_bt_iter_pos_u’
# 2438|       slots
# 2439|     };
# 2440|->   PyObject *pytype = PyType_FromSpec(&spec);
# 2441|     PyObject *runtime_data_module = SWIG_runtime_data_module();
# 2442|   #if !defined(Py_LIMITED_API)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:2453:17: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5267:22: enter_function: entry to ‘_wrap_new_bt_iter_pos_u’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘_wrap_new_bt_iter_pos_u’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:8: return_function: returning to ‘_wrap_new_bt_iter_pos_u’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5273:29: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5273:29: acquire_memory: allocated here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5274:15: call_function: calling ‘SWIG_Python_NewPointerObj’ from ‘_wrap_new_bt_iter_pos_u’
# 2451|   #endif
# 2452|   #endif
# 2453|->   if (pytype && PyModule_AddObject(runtime_data_module, "SwigPyObject", pytype) == 0)
# 2454|       SWIG_Py_INCREF(pytype);
# 2455|     return (PyTypeObject *)pytype;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:2462:24: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5267:22: enter_function: entry to ‘_wrap_new_bt_iter_pos_u’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘_wrap_new_bt_iter_pos_u’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:8: return_function: returning to ‘_wrap_new_bt_iter_pos_u’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5273:29: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5273:29: acquire_memory: allocated here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5274:15: call_function: calling ‘SWIG_Python_NewPointerObj’ from ‘_wrap_new_bt_iter_pos_u’
# 2460|   SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
# 2461|   {
# 2462|->   SwigPyObject *sobj = PyObject_New(SwigPyObject, SwigPyObject_Type());
# 2463|     if (sobj) {
# 2464|       sobj->ptr  = ptr;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:3136:16: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5267:22: enter_function: entry to ‘_wrap_new_bt_iter_pos_u’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:8: call_function: calling ‘SWIG_Python_UnpackTuple’ from ‘_wrap_new_bt_iter_pos_u’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:8: return_function: returning to ‘_wrap_new_bt_iter_pos_u’ from ‘SWIG_Python_UnpackTuple’
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5272:6: branch_false: following ‘false’ branch...
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5273:29: branch_false: ...to here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5273:29: acquire_memory: allocated here
babeltrace-1.5.11/bindings/python/babeltrace/babeltrace_wrap.c:5274:15: call_function: calling ‘SWIG_Python_NewPointerObj’ from ‘_wrap_new_bt_iter_pos_u’
# 3134|         }
# 3135|       } else {
# 3136|->       newobj = PyObject_New(SwigPyObject, clientdata->pytype);
# 3137|         if (newobj) {
# 3138|           newobj->swigdict = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
babeltrace-1.5.11/converter/babeltrace-log.c:323:15: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_fp’
babeltrace-1.5.11/converter/babeltrace-log.c:386:5: enter_function: entry to ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:394:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:400:13: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:400:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:405:15: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:406:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
babeltrace-1.5.11/converter/babeltrace-log.c:411:15: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:412:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:416:18: call_function: inlined call to ‘bt_dirfd’ from ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:417:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:422:14: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:424:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:429:23: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:431:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:435:23: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:435:23: acquire_memory: allocated here
babeltrace-1.5.11/converter/babeltrace-log.c:436:12: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/converter/babeltrace-log.c:441:9: call_function: inlined call to ‘bt_uuid_generate’ from ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:443:9: call_function: calling ‘trace_text’ from ‘main’
#  321|   
#  322|   	memset(&pos, 0, sizeof(pos));
#  323|-> 	ret = ctf_init_pos(&pos, NULL, output, O_RDWR);
#  324|   	if (ret) {
#  325|   		fprintf(stderr, "Error in ctf_init_pos\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
babeltrace-1.5.11/converter/babeltrace-log.c:328:9: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_fp’
babeltrace-1.5.11/converter/babeltrace-log.c:386:5: enter_function: entry to ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:394:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:400:13: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:400:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:405:15: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:406:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
babeltrace-1.5.11/converter/babeltrace-log.c:411:15: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:412:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:416:18: call_function: inlined call to ‘bt_dirfd’ from ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:417:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:422:14: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:424:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:429:23: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:431:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:435:23: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:435:23: acquire_memory: allocated here
babeltrace-1.5.11/converter/babeltrace-log.c:436:12: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/converter/babeltrace-log.c:441:9: call_function: inlined call to ‘bt_uuid_generate’ from ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:443:9: call_function: calling ‘trace_text’ from ‘main’
#  326|   		return;
#  327|   	}
#  328|-> 	ctf_packet_seek(&pos.parent, 0, SEEK_CUR);
#  329|   	write_packet_header(&pos, s_uuid);
#  330|   	write_packet_context(&pos);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
babeltrace-1.5.11/converter/babeltrace.c:460:25: warning[-Wanalyzer-malloc-leak]: leak of ‘ipath_copy’
babeltrace-1.5.11/converter/babeltrace.c:299:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
babeltrace-1.5.11/converter/babeltrace.c:304:14: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace.c:451:20: branch_true: following ‘true’ branch...
babeltrace-1.5.11/converter/babeltrace.c:452:47: branch_true: ...to here
babeltrace-1.5.11/converter/babeltrace.c:452:47: acquire_memory: allocated here
babeltrace-1.5.11/converter/babeltrace.c:454:28: branch_false: following ‘false’ branch (when ‘ipath_copy’ is non-NULL)...
babeltrace-1.5.11/converter/babeltrace.c:460:25: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace.c:460:25: danger: ‘ipath_copy’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  458|   			}
#  459|   
#  460|-> 			g_ptr_array_add(opt_input_paths, ipath_copy);
#  461|   		}
#  462|   	} while (ipath);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
babeltrace-1.5.11/converter/babeltrace.c:500:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fpath, 0)’
babeltrace-1.5.11/converter/babeltrace.c:491:12: branch_false: following ‘false’ branch (when ‘tflag == 1’)...
babeltrace-1.5.11/converter/babeltrace.c:494:17: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace.c:494:17: acquire_resource: opened here
babeltrace-1.5.11/converter/babeltrace.c:495:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace.c:500:18: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace.c:500:18: danger: ‘open(fpath, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  498|   		return 0;	/* partial error */
#  499|   	}
#  500|-> 	metafd = openat(dirfd, "metadata", O_RDONLY);
#  501|   	if (metafd < 0) {
#  502|   		closeret = close(dirfd);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def18]
babeltrace-1.5.11/formats/ctf/callbacks.c:47:15: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
babeltrace-1.5.11/formats/ctf/callbacks.c:59:25: enter_function: entry to 'bt_dependencies_create'
babeltrace-1.5.11/formats/ctf/callbacks.c:64:9: acquire_resource: 'va_start' called here
babeltrace-1.5.11/formats/ctf/callbacks.c:65:16: call_function: calling '_bt_dependencies_create' from 'bt_dependencies_create'
#   45|   	struct bt_dependencies *dep;
#   46|   
#   47|-> 	dep = g_new0(struct bt_dependencies, 1);
#   48|   	dep->refcount = 1;
#   49|   	dep->deps = g_array_new(FALSE, TRUE, sizeof(GQuark));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
babeltrace-1.5.11/formats/ctf/ctf.c:1401:15: warning[-Wanalyzer-malloc-leak]: leak of 'open_memstream(buf, & size)'
babeltrace-1.5.11/formats/ctf/ctf.c:2680:5: enter_function: entry to 'ctf_append_trace_metadata'
babeltrace-1.5.11/formats/ctf/ctf.c:2687:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ctf.c:2689:15: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ctf.c:2689:15: call_function: calling 'ctf_trace_metadata_read' from 'ctf_append_trace_metadata'
# 1399|   read_padding:
# 1400|   	toread = (header.packet_size - header.content_size) / CHAR_BIT;
# 1401|-> 	ret = fseek(in, toread, SEEK_CUR);
# 1402|   	if (ret < 0) {
# 1403|   		fprintf(stderr, "[warning] Missing padding at end of file\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
babeltrace-1.5.11/formats/ctf/ctf.c:2348:21: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
babeltrace-1.5.11/formats/ctf/ctf.c:2443:29: enter_function: entry to 'ctf_open_trace'
babeltrace-1.5.11/formats/ctf/ctf.c:2457:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ctf.c:2460:9: call_function: inlined call to 'init_trace_descriptor' from 'ctf_open_trace'
babeltrace-1.5.11/formats/ctf/ctf.c:2464:20: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/formats/ctf/ctf.c:2468:23: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ctf.c:2468:23: call_function: calling 'ctf_open_trace_read' from 'ctf_open_trace'
# 2346|   	}
# 2347|   
# 2348|-> 	td->dirfd = open(path, 0);
# 2349|   	if (td->dirfd < 0) {
# 2350|   		fprintf(stderr, "[error] Unable to open trace directory file descriptor for path \"%s\".\n", path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
babeltrace-1.5.11/formats/ctf/ctf.c:2351:17: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
babeltrace-1.5.11/formats/ctf/ctf.c:2443:29: enter_function: entry to 'ctf_open_trace'
babeltrace-1.5.11/formats/ctf/ctf.c:2457:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ctf.c:2460:9: call_function: inlined call to 'init_trace_descriptor' from 'ctf_open_trace'
babeltrace-1.5.11/formats/ctf/ctf.c:2464:20: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/formats/ctf/ctf.c:2468:23: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ctf.c:2468:23: call_function: calling 'ctf_open_trace_read' from 'ctf_open_trace'
# 2349|   	if (td->dirfd < 0) {
# 2350|   		fprintf(stderr, "[error] Unable to open trace directory file descriptor for path \"%s\".\n", path);
# 2351|-> 		perror("Trace directory open");
# 2352|   		ret = -errno;
# 2353|   		goto error_dirfd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
babeltrace-1.5.11/formats/ctf/ctf.c:2356:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor
babeltrace-1.5.11/formats/ctf/ctf.c:2342:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ctf.c:2348:21: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ctf.c:2348:21: acquire_resource: opened here
babeltrace-1.5.11/formats/ctf/ctf.c:2349:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ctf.c:2355:17: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ctf.c:2356:9: danger: leaks here; was opened at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 2354|   	}
# 2355|   	strncpy(td->parent.path, path, sizeof(td->parent.path));
# 2356|-> 	td->parent.path[sizeof(td->parent.path) - 1] = '\0';
# 2357|   
# 2358|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
babeltrace-1.5.11/formats/ctf/ctf.c:2356:9: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
babeltrace-1.5.11/formats/ctf/ctf.c:2341:19: acquire_memory: allocated here
babeltrace-1.5.11/formats/ctf/ctf.c:2342:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ctf.c:2348:21: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ctf.c:2349:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ctf.c:2355:17: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ctf.c:2356:9: danger: '<unknown>' leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 2354|   	}
# 2355|   	strncpy(td->parent.path, path, sizeof(td->parent.path));
# 2356|-> 	td->parent.path[sizeof(td->parent.path) - 1] = '\0';
# 2357|   
# 2358|   	/*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def24]
babeltrace-1.5.11/formats/ctf/ctf.c:2363:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor
babeltrace-1.5.11/formats/ctf/ctf.c:2443:29: enter_function: entry to 'ctf_open_trace'
babeltrace-1.5.11/formats/ctf/ctf.c:2457:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ctf.c:2460:9: call_function: inlined call to 'init_trace_descriptor' from 'ctf_open_trace'
babeltrace-1.5.11/formats/ctf/ctf.c:2464:20: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/formats/ctf/ctf.c:2468:23: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ctf.c:2468:23: call_function: calling 'ctf_open_trace_read' from 'ctf_open_trace'
# 2361|   	 * incremental metadata append for on-disk traces.
# 2362|   	 */
# 2363|-> 	scanner = ctf_scanner_alloc();
# 2364|   	if (!scanner) {
# 2365|   		fprintf(stderr, "[error] Error allocating scanner\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
babeltrace-1.5.11/formats/ctf/ctf.c:2363:19: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
babeltrace-1.5.11/formats/ctf/ctf.c:2443:29: enter_function: entry to 'ctf_open_trace'
babeltrace-1.5.11/formats/ctf/ctf.c:2457:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ctf.c:2460:9: call_function: inlined call to 'init_trace_descriptor' from 'ctf_open_trace'
babeltrace-1.5.11/formats/ctf/ctf.c:2464:20: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/formats/ctf/ctf.c:2468:23: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ctf.c:2468:23: call_function: calling 'ctf_open_trace_read' from 'ctf_open_trace'
# 2361|   	 * incremental metadata append for on-disk traces.
# 2362|   	 */
# 2363|-> 	scanner = ctf_scanner_alloc();
# 2364|   	if (!scanner) {
# 2365|   		fprintf(stderr, "[error] Error allocating scanner\n");

Error: COMPILER_WARNING (CWE-477): [#def26]
babeltrace-1.5.11/formats/ctf/ctf.c: scope_hint: In function 'ctf_open_trace_read'
babeltrace-1.5.11/formats/ctf/ctf.c:2391:17: warning[-Wdeprecated-declarations]: 'readdir_r' is deprecated
# 2391 |                 ret = readdir_r(td->dir, dirent, &diriter);
#      |                 ^~~
/usr/include/glib-2.0/glib/gdir.h:34: included_from: Included from here.
/usr/include/glib-2.0/glib.h:47: included_from: Included from here.
babeltrace-1.5.11/include/babeltrace/context-internal.h:34: included_from: Included from here.
babeltrace-1.5.11/include/babeltrace/format-internal.h:33: included_from: Included from here.
babeltrace-1.5.11/formats/ctf/ctf.c:30: included_from: Included from here.
/usr/include/dirent.h:185:12: note: declared here
#  185 | extern int readdir_r (DIR *__restrict __dirp,
#      |            ^~~~~~~~~
# 2389|   
# 2390|   	for (;;) {
# 2391|-> 		ret = readdir_r(td->dir, dirent, &diriter);
# 2392|   		if (ret) {
# 2393|   			fprintf(stderr, "[error] Readdir error.\n");

Error: COMPILER_WARNING (CWE-477): [#def27]
babeltrace-1.5.11/formats/ctf/ctf.c:2391:17: warning[-Wdeprecated-declarations]: 'readdir_r' is deprecated
# 2389|   
# 2390|   	for (;;) {
# 2391|-> 		ret = readdir_r(td->dir, dirent, &diriter);
# 2392|   		if (ret) {
# 2393|   			fprintf(stderr, "[error] Readdir error.\n");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def28]
babeltrace-1.5.11/formats/ctf/ir/event.c:476:13: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
babeltrace-1.5.11/formats/ctf/ir/event.c:457:5: enter_function: entry to 'bt_ctf_event_set_header'
babeltrace-1.5.11/formats/ctf/ir/event.c:464:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ir/event.c:469:55: call_function: inlined call to 'bt_object_get_parent' from 'bt_ctf_event_set_header'
babeltrace-1.5.11/formats/ctf/ir/event.c:475:22: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ir/event.c:476:13: danger: dereference of NULL '<unknown>'
#  474|   	 */
#  475|   	field_type = bt_ctf_field_get_type(header);
#  476|-> 	if (bt_ctf_field_type_compare(field_type,
#  477|   			stream_class->event_header_type)) {
#  478|   		ret = -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def29]
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1063:33: warning[-Wanalyzer-null-dereference]: dereference of NULL 'entry'
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1104:5: enter_function: entry to 'bt_ctf_resolve_types'
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1130:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1137:13: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1137:12: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1138:23: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1138:23: call_function: calling 'resolve_root_type' from 'bt_ctf_resolve_types'
# 1061|   			if (type_id == CTF_TYPE_ARRAY ||
# 1062|   					type_id == CTF_TYPE_SEQUENCE) {
# 1063|-> 				type_stack_peek(ctx->type_stack)->index = -1;
# 1064|   			} else {
# 1065|   				type_stack_peek(ctx->type_stack)->index =

Error: GCC_ANALYZER_WARNING (CWE-476): [#def30]
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1065:33: warning[-Wanalyzer-null-dereference]: dereference of NULL 'entry'
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1104:5: enter_function: entry to 'bt_ctf_resolve_types'
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1130:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1137:13: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1137:12: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1138:23: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/ir/resolve.c:1138:23: call_function: calling 'resolve_root_type' from 'bt_ctf_resolve_types'
# 1063|   				type_stack_peek(ctx->type_stack)->index = -1;
# 1064|   			} else {
# 1065|-> 				type_stack_peek(ctx->type_stack)->index =
# 1066|   					f_index;
# 1067|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1958:12: warning[-Wanalyzer-malloc-leak]: leak of 'bt_yyalloc(64, yyscanner)'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1944:21: enter_function: entry to 'bt_yy_create_buffer'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1948:31: call_function: calling 'bt_yyalloc' from 'bt_yy_create_buffer'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1948:31: return_function: returning to 'bt_yy_create_buffer' from 'bt_yyalloc'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1949:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1952:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1958:12: danger: 'bt_yyalloc(64, yyscanner)' leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
# 1956|   	 */
# 1957|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1958|-> 	if ( ! b->yy_ch_buf )
# 1959|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
# 1960|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def32]
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:2000:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'b'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1879:10: enter_function: entry to 'yyrestart'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1884:9: call_function: calling 'yyensure_buffer_stack' from 'yyrestart'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1884:9: return_function: returning to 'yyrestart' from 'yyensure_buffer_stack'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1886:13: call_function: calling 'bt_yy_create_buffer' from 'yyrestart'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1886:13: return_function: returning to 'yyrestart' from 'bt_yy_create_buffer'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1889:9: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1889:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:1889:9: call_function: calling 'yy_init_buffer' from 'yyrestart'
# 1998|   	yy_flush_buffer( b , yyscanner);
# 1999|   
# 2000|-> 	b->yy_input_file = file;
# 2001|   	b->yy_fill_buffer = 1;
# 2002|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:2218:33: warning[-Wanalyzer-malloc-leak]: leak of 'bt_yyalloc(n,  yyscanner)'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:2202:17: enter_function: entry to 'bt_yy_scan_bytes'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:2211:24: call_function: calling 'bt_yyalloc' from 'bt_yy_scan_bytes'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:2211:24: return_function: returning to 'bt_yy_scan_bytes' from 'bt_yyalloc'
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:2212:12: branch_false: following 'false' branch...
 branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-lexer.c:2220:13: call_function: calling 'bt_yy_scan_buffer' from 'bt_yy_scan_bytes'
# 2216|   		buf[i] = yybytes[i];
# 2217|   
# 2218|-> 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 2219|   
# 2220|   	b = yy_scan_buffer( buf, n , yyscanner);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def34]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:71:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘trace’ where non-null expected
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:49:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:53:15: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:54:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:59:49: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:60:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:65:54: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:70:17: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:70:17: acquire_memory: this call could return NULL
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:71:9: danger: argument 1 (‘trace’) from [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8) could be NULL where non-null expected
#argument 1 of ‘__builtin_memset’ must be non-null
#   69|   	}
#   70|   	trace = malloc(sizeof(*trace));
#   71|-> 	memset(trace, 0, sizeof(*trace));
#   72|   	ret = ctf_visitor_construct_metadata(stderr, 0, &scanner->ast->root,
#   73|   			trace, BYTE_ORDER);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:72:15: warning[-Wanalyzer-malloc-leak]: leak of ‘trace’
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:49:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:53:15: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:54:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:59:49: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:60:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:65:54: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:70:17: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:70:17: acquire_memory: allocated here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser-test.c:72:15: danger: ‘trace’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#   70|   	trace = malloc(sizeof(*trace));
#   71|   	memset(trace, 0, sizeof(*trace));
#   72|-> 	ret = ctf_visitor_construct_metadata(stderr, 0, &scanner->ast->root,
#   73|   			trace, BYTE_ORDER);
#   74|   	if (ret) {

Error: GCC_ANALYZER_WARNING (CWE-127): [#def36]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2640:45: warning[-Wanalyzer-out-of-bounds]: buffer under-read
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2791:1: enter_function: entry to 'yyparse'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_false: following 'false' branch (when 'yyn > 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: following 'false' branch (when 'yyerrstatus == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2994:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2876:31: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2903:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2905:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2913:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2918:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2924:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2930:10: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_true: following 'true' branch (when 'yyn == -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2952:5: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:3012:6: branch_true: following 'true' branch (when 'yyn == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:3013:5: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:5294:13: branch_false: following 'false' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:5297:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:5297:6: branch_true: following 'true' branch (when 'yyerrstatus == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:5308:33: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:5308:33: call_function: calling 'yysyntax_error' from 'yyparse'
# 2638|                   yytype_int16 *yyssp, int yytoken)
# 2639|   {
# 2640|->   YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
# 2641|     YYSIZE_T yysize = yysize0;
# 2642|     enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2912:29: warning[-Wanalyzer-malloc-leak]: leak of 'yyptr'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_false: following 'false' branch (when 'yyn > 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: following 'false' branch (when 'yyerrstatus == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2994:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2876:31: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2903:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2905:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2912:29: acquire_memory: allocated here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2913:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2918:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2924:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2930:10: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_false: following 'false' branch (when 'yyn > 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: following 'false' branch (when 'yyerrstatus == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2994:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2876:31: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2903:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2905:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2912:29: danger: 'yyptr' leaks here; was allocated at [(19)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/18)
# 2910|           yytype_int16 *yyss1 = yyss;
# 2911|           union yyalloc *yyptr =
# 2912|->           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
# 2913|           if (! yyptr)
# 2914|             goto yyexhaustedlab;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def38]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'yyss'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2876:31: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2903:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2905:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2913:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: danger: use of uninitialized value 'yyss' here
# 2913|           if (! yyptr)
# 2914|             goto yyexhaustedlab;
# 2915|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 2916|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 2917|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2960:16: warning[-Wanalyzer-malloc-leak]: leak of 'yyptr'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_false: following 'false' branch (when 'yyn > 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: following 'false' branch (when 'yyerrstatus == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2994:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2876:31: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2903:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2905:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2912:29: acquire_memory: allocated here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2913:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2918:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2924:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2930:10: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2960:16: danger: 'yyptr' leaks here; was allocated at [(19)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/18)
# 2958|       {
# 2959|         YYDPRINTF ((stderr, "Reading a token: "));
# 2960|->       yychar = yylex (&yylval, yyscanner);
# 2961|       }
# 2962|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def40]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:298:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'scope'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2791:1: enter_function: entry to 'yyparse'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:1404:27: call_function: calling 'push_scope' from 'yyparse'
#  296|   		       struct ctf_scanner_scope *parent)
#  297|   {
#  298|-> 	scope->parent = parent;
#  299|   	scope->types = g_hash_table_new_full(g_str_hash, g_str_equal,
#  300|   					     NULL, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:299:24: warning[-Wanalyzer-malloc-leak]: leak of 'ns'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2791:1: enter_function: entry to 'yyparse'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:1404:27: call_function: calling 'push_scope' from 'yyparse'
#  297|   {
#  298|   	scope->parent = parent;
#  299|-> 	scope->types = g_hash_table_new_full(g_str_hash, g_str_equal,
#  300|   					     NULL, NULL);
#  301|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:299:24: warning[-Wanalyzer-malloc-leak]: leak of 'yyptr'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2791:1: enter_function: entry to 'yyparse'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_false: following 'false' branch (when 'yyn > 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: following 'false' branch (when 'yyerrstatus == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2994:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2876:31: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2903:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2905:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2912:29: acquire_memory: allocated here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2913:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2918:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2924:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2930:10: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:3012:6: branch_false: following 'false' branch (when 'yyn != 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:3014:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:1404:27: call_function: calling 'push_scope' from 'yyparse'
#  297|   {
#  298|   	scope->parent = parent;
#  299|-> 	scope->types = g_hash_table_new_full(g_str_hash, g_str_equal,
#  300|   					     NULL, NULL);
#  301|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:305:9: warning[-Wanalyzer-malloc-leak]: leak of 'yyptr'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2791:1: enter_function: entry to 'yyparse'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_false: following 'false' branch (when 'yyn > 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: following 'false' branch (when 'yyerrstatus == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2994:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2876:31: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2903:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2905:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2912:29: acquire_memory: allocated here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2913:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2918:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2924:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2930:10: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:3012:6: branch_false: following 'false' branch (when 'yyn != 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:3014:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:1409:27: call_function: calling 'pop_scope' from 'yyparse'
#  303|   static void finalize_scope(struct ctf_scanner_scope *scope)
#  304|   {
#  305|-> 	g_hash_table_destroy(scope->types);
#  306|   }
#  307|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:367:16: warning[-Wanalyzer-malloc-leak]: leak of 'yyptr'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2791:1: enter_function: entry to 'yyparse'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_false: following 'false' branch (when 'yyn > 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: following 'false' branch (when 'yyerrstatus == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2994:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2876:31: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2903:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2905:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2912:29: acquire_memory: allocated here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2913:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2918:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2924:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2930:10: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_true: following 'true' branch (when 'yyn <= 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2984:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:1190:37: call_function: calling 'make_node' from 'yyparse'
#  365|   	struct ctf_node *node;
#  366|   
#  367|-> 	node = objstack_alloc(scanner->objstack, sizeof(*node));
#  368|   	if (!node) {
#  369|   		printfl_fatal(yyget_lineno(scanner->scanner), "out of memory");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:369:17: warning[-Wanalyzer-malloc-leak]: leak of 'yyptr'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2791:1: enter_function: entry to 'yyparse'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_false: following 'false' branch (when 'yyn > 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: following 'false' branch (when 'yyerrstatus == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2994:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2876:31: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2903:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2905:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2912:29: acquire_memory: allocated here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2913:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2918:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2924:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2930:10: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_true: following 'true' branch (when 'yyn <= 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2984:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:1190:37: call_function: calling 'make_node' from 'yyparse'
#  367|   	node = objstack_alloc(scanner->objstack, sizeof(*node));
#  368|   	if (!node) {
#  369|-> 		printfl_fatal(yyget_lineno(scanner->scanner), "out of memory");
#  370|   		return &error_node;
#  371|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:939:9: warning[-Wanalyzer-malloc-leak]: leak of 'yyptr'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2791:1: enter_function: entry to 'yyparse'
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2951:6: branch_false: following 'false' branch (when 'yyn != -363')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2957:6: branch_true: following 'true' branch (when 'yychar == -2')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2959:7: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2977:6: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2980:6: branch_false: following 'false' branch (when 'yyn > 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2990:6: branch_false: following 'false' branch (when 'yyerrstatus == 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2994:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2873:6: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2876:31: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2903:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2905:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2912:29: acquire_memory: allocated here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2913:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2915:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2918:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2924:7: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2930:10: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2934:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2936:6: branch_false: following 'false' branch (when 'yystate != 72')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:2939:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:3012:6: branch_false: following 'false' branch (when 'yyn != 0')...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.c:3014:3: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:1289:28: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:1291:33: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/ctf-parser.y:1291:33: call_function: calling 'yyerror' from 'yyparse'
#  937|   void yyerror(struct ctf_scanner *scanner, yyscan_t yyscanner, const char *str)
#  938|   {
#  939|-> 	printfl_error(yyget_lineno(scanner->scanner),
#  940|   		"token \"%s\": %s\n",
#  941|   		yyget_text(scanner->scanner), str);

Error: COMPILER_WARNING (CWE-457): [#def47]
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2745:37: warning[-Wmaybe-uninitialized]: 'v' may be used uninitialized
# 2745 |                         env->vpid = (int) v;
#      |                                     ^~~~~~~
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c: scope_hint: In function 'ctf_visitor_construct_metadata'
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:2734:34: note: 'v' was declared here
# 2734 |                         uint64_t v;
#      |                                  ^
# 2743|   				goto error;	/* ret is 0, so not an actual error, just warn. */
# 2744|   			}
# 2745|-> 			env->vpid = (int) v;
# 2746|   			printf_verbose("env.vpid = %d\n", env->vpid);
# 2747|   		} else if (!strcmp(left, "procname")) {

Error: COMPILER_WARNING (CWE-697): [#def48]
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c: scope_hint: In function 'ctf_destroy_metadata'
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:3118:45: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'p' will never be NULL
# 3118 |                                         if (&event->event_fields->p)
#      |                                             ^
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:37: included_from: Included from here.
babeltrace-1.5.11/include/babeltrace/types.h:272:30: note: 'p' declared here
#  272 |         struct bt_definition p;
#      |                              ^
# 3116|   					if (!event)
# 3117|   						continue;
# 3118|-> 					if (&event->event_fields->p)
# 3119|   						bt_definition_unref(&event->event_fields->p);
# 3120|   					if (&event->event_context->p)

Error: COMPILER_WARNING (CWE-697): [#def49]
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:3120:45: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'p' will never be NULL
# 3120 |                                         if (&event->event_context->p)
#      |                                             ^
babeltrace-1.5.11/include/babeltrace/types.h:272:30: note: 'p' declared here
#  272 |         struct bt_definition p;
#      |                              ^
# 3118|   					if (&event->event_fields->p)
# 3119|   						bt_definition_unref(&event->event_fields->p);
# 3120|-> 					if (&event->event_context->p)
# 3121|   						bt_definition_unref(&event->event_context->p);
# 3122|   					g_free(event);

Error: COMPILER_WARNING (CWE-697): [#def50]
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:3124:37: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'p' will never be NULL
# 3124 |                                 if (&stream_def->trace_packet_header->p)
#      |                                     ^
babeltrace-1.5.11/include/babeltrace/types.h:272:30: note: 'p' declared here
#  272 |         struct bt_definition p;
#      |                              ^
# 3122|   					g_free(event);
# 3123|   				}
# 3124|-> 				if (&stream_def->trace_packet_header->p)
# 3125|   					bt_definition_unref(&stream_def->trace_packet_header->p);
# 3126|   				if (&stream_def->stream_event_header->p)

Error: COMPILER_WARNING (CWE-697): [#def51]
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:3126:37: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'p' will never be NULL
# 3126 |                                 if (&stream_def->stream_event_header->p)
#      |                                     ^
babeltrace-1.5.11/include/babeltrace/types.h:272:30: note: 'p' declared here
#  272 |         struct bt_definition p;
#      |                              ^
# 3124|   				if (&stream_def->trace_packet_header->p)
# 3125|   					bt_definition_unref(&stream_def->trace_packet_header->p);
# 3126|-> 				if (&stream_def->stream_event_header->p)
# 3127|   					bt_definition_unref(&stream_def->stream_event_header->p);
# 3128|   				if (&stream_def->stream_packet_context->p)

Error: COMPILER_WARNING (CWE-697): [#def52]
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:3128:37: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'p' will never be NULL
# 3128 |                                 if (&stream_def->stream_packet_context->p)
#      |                                     ^
babeltrace-1.5.11/include/babeltrace/types.h:272:30: note: 'p' declared here
#  272 |         struct bt_definition p;
#      |                              ^
# 3126|   				if (&stream_def->stream_event_header->p)
# 3127|   					bt_definition_unref(&stream_def->stream_event_header->p);
# 3128|-> 				if (&stream_def->stream_packet_context->p)
# 3129|   					bt_definition_unref(&stream_def->stream_packet_context->p);
# 3130|   				if (&stream_def->stream_event_context->p)

Error: COMPILER_WARNING (CWE-697): [#def53]
babeltrace-1.5.11/formats/ctf/metadata/ctf-visitor-generate-io-struct.c:3130:37: warning[-Waddress]: the comparison will always evaluate as 'true' for the address of 'p' will never be NULL
# 3130 |                                 if (&stream_def->stream_event_context->p)
#      |                                     ^
babeltrace-1.5.11/include/babeltrace/types.h:272:30: note: 'p' declared here
#  272 |         struct bt_definition p;
#      |                              ^
# 3128|   				if (&stream_def->stream_packet_context->p)
# 3129|   					bt_definition_unref(&stream_def->stream_packet_context->p);
# 3130|-> 				if (&stream_def->stream_event_context->p)
# 3131|   					bt_definition_unref(&stream_def->stream_event_context->p);
# 3132|   				g_ptr_array_free(stream_def->events_by_id, TRUE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:64:9: warning[-Wanalyzer-malloc-leak]: leak of 'node'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:54:12: branch_false: following 'false' branch (when 'objstack' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:56:16: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:56:16: acquire_memory: allocated here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:58:12: branch_false: following 'false' branch (when 'node' is non-NULL)...
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:62:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:64:9: danger: 'node' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   62|   	BT_INIT_LIST_HEAD(&objstack->head);
#   63|   	bt_list_add_tail(&node->node, &objstack->head);
#   64|-> 	node->len = OBJSTACK_INIT_LEN;
#   65|   	return objstack;
#   66|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:130:20: warning[-Wanalyzer-malloc-leak]: leak of 'last_node'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:118:7: enter_function: entry to 'objstack_alloc'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:128:16: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: call_function: calling 'objstack_append_node' from 'objstack_alloc'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: return_function: returning to 'objstack_alloc' from 'objstack_append_node'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:130:20: branch_false: following 'false' branch...
 branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:128:16: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: call_function: calling 'objstack_append_node' from 'objstack_alloc'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: return_function: returning to 'objstack_alloc' from 'objstack_append_node'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:130:20: branch_false: following 'false' branch...
 branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:128:16: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: call_function: calling 'objstack_append_node' from 'objstack_alloc'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: return_function: returning to 'objstack_alloc' from 'objstack_append_node'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:130:20: branch_true: following 'true' branch...
 branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:130:20: danger: 'last_node' leaks here; was allocated at [(15)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/14)
#  128|   	while (last_node->len - last_node->used_len < len) {
#  129|   		last_node = objstack_append_node(objstack);
#  130|-> 		if (!last_node) {
#  131|   			return NULL;
#  132|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:135:9: warning[-Wanalyzer-malloc-leak]: leak of 'last_node'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:118:7: enter_function: entry to 'objstack_alloc'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:128:16: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: call_function: calling 'objstack_append_node' from 'objstack_alloc'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: return_function: returning to 'objstack_alloc' from 'objstack_append_node'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:130:20: branch_false: following 'false' branch...
 branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:128:16: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: branch_true: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: call_function: calling 'objstack_append_node' from 'objstack_alloc'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:129:29: return_function: returning to 'objstack_alloc' from 'objstack_append_node'
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:130:20: branch_false: following 'false' branch...
 branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:128:16: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:134:9: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/metadata/objstack.c:135:9: danger: 'last_node' leaks here; was allocated at [(15)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/14)
#  133|   	}
#  134|   	p = &last_node->data[last_node->used_len];
#  135|-> 	last_node->used_len += len;
#  136|   	return p;
#  137|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def57]
babeltrace-1.5.11/formats/ctf/writer/writer.c:108:13: warning[-Wanalyzer-null-dereference]: dereference of NULL 'obj'
babeltrace-1.5.11/formats/ctf/writer/writer.c:102:6: enter_function: entry to 'bt_ctf_writer_destroy'
babeltrace-1.5.11/formats/ctf/writer/writer.c:107:9: call_function: calling 'bt_ctf_writer_flush_metadata' from 'bt_ctf_writer_destroy'
babeltrace-1.5.11/formats/ctf/writer/writer.c:107:9: return_function: returning to 'bt_ctf_writer_destroy' from 'bt_ctf_writer_flush_metadata'
babeltrace-1.5.11/formats/ctf/writer/writer.c:108:13: danger: dereference of NULL 'obj'
#  106|   	writer = container_of(obj, struct bt_ctf_writer, base);
#  107|   	bt_ctf_writer_flush_metadata(writer);
#  108|-> 	if (writer->path) {
#  109|   		g_string_free(writer->path, TRUE);
#  110|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:87:23: warning[-Wanalyzer-malloc-leak]: leak of 'data'
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1212:6: enter_function: entry to 'ctf_live_packet_seek'
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1230:12: branch_false: following 'false' branch...
 branch_false: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1264:12: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1265:17: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1265:17: call_function: calling 'lttng_index_to_packet_index' from 'ctf_live_packet_seek'
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1265:17: return_function: returning to 'ctf_live_packet_seek' from 'lttng_index_to_packet_index'
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1295:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1312:28: branch_false: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1315:12: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1321:12: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1321:12: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1323:21: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1323:20: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1325:33: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1381:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1386:13: branch_false: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1386:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1392:15: call_function: calling 'get_data_packet' from 'ctf_live_packet_seek'
#   85|   
#   86|   	do {
#   87|-> 		ret = recv(fd, buf + copied, to_copy, 0);
#   88|   		if (ret > 0) {
#   89|   			assert(ret <= to_copy);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def59]
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1342:25: warning[-Wanalyzer-null-argument]: use of NULL 'prev_index' where non-null expected
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1212:6: enter_function: entry to 'ctf_live_packet_seek'
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1230:12: branch_false: following 'false' branch...
 branch_false: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1264:12: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1265:17: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1265:17: call_function: calling 'lttng_index_to_packet_index' from 'ctf_live_packet_seek'
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1265:17: return_function: returning to 'ctf_live_packet_seek' from 'lttng_index_to_packet_index'
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1295:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1312:28: branch_false: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1315:12: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1321:12: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1321:12: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1323:21: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1323:20: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1325:33: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1342:25: danger: argument 2 ('prev_index') NULL where non-null expected
#argument 2 of '__builtin_memcpy' must be non-null
# 1340|   			 * have fake indexes between real indexes.
# 1341|   			 */
# 1342|-> 			memcpy(cur_index, prev_index, sizeof(struct packet_index));
# 1343|   		}
# 1344|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1528:43: warning[-Wanalyzer-malloc-leak]: leak of 'new_mmap_stream'
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1512:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1522:9: branch_false: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1526:9: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1527:22: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1527:20: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1528:43: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1528:43: acquire_memory: allocated here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1526:9: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1527:22: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1527:20: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1528:43: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1528:43: danger: 'new_mmap_stream' leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
# 1526|   	bt_list_for_each_entry(stream, &trace->stream_list, trace_stream_node) {
# 1527|   		if (!stream->metadata_flag) {
# 1528|-> 			new_mmap_stream = zmalloc(sizeof(struct bt_mmap_stream));
# 1529|   			new_mmap_stream->priv = (void *) stream;
# 1530|   			new_mmap_stream->fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def61]
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1529:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'new_mmap_stream'
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1512:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1522:9: branch_false: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1526:9: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1527:22: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1527:20: branch_true: following 'true' branch...
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1528:43: branch_true: ...to here
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1528:43: acquire_memory: this call could return NULL
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:1529:25: danger: 'new_mmap_stream' could be NULL: unchecked value from [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
# 1527|   		if (!stream->metadata_flag) {
# 1528|   			new_mmap_stream = zmalloc(sizeof(struct bt_mmap_stream));
# 1529|-> 			new_mmap_stream->priv = (void *) stream;
# 1530|   			new_mmap_stream->fd = -1;
# 1531|   			bt_list_add(&new_mmap_stream->list, &mmap_list.head);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
babeltrace-1.5.11/include/babeltrace/compat/stdio.h:89:23: warning[-Wanalyzer-malloc-leak]: leak of ‘babeltrace_output_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:166:6: enter_function: entry to ‘validate_trace’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:211:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:213:24: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:216:40: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:224:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:228:24: call_function: calling ‘bt_getline’ from ‘validate_trace’
#   87|   		int ret;
#   88|   
#   89|-> 		ret = fgetc(stream);
#   90|   		if (ret == EOF) {
#   91|   			if (ferror(stream)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
babeltrace-1.5.11/include/babeltrace/compat/stdio.h:89:23: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:166:6: enter_function: entry to ‘validate_trace’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:211:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:213:24: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:224:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:228:24: call_function: calling ‘bt_getline’ from ‘validate_trace’
#   87|   		int ret;
#   88|   
#   89|-> 		ret = fgetc(stream);
#   90|   		if (ret == EOF) {
#   91|   			if (ferror(stream)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
babeltrace-1.5.11/include/babeltrace/compat/stdio.h:89:23: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:50:6: enter_function: entry to ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:109:31: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: call_function: calling ‘bt_getline’ from ‘validate_metadata’
#   87|   		int ret;
#   88|   
#   89|-> 		ret = fgetc(stream);
#   90|   		if (ret == EOF) {
#   91|   			if (ferror(stream)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
babeltrace-1.5.11/include/babeltrace/compat/stdio.h:89:23: warning[-Wanalyzer-malloc-leak]: leak of ‘parser_output_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:50:6: enter_function: entry to ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: call_function: calling ‘bt_getline’ from ‘validate_metadata’
#   87|   		int ret;
#   88|   
#   89|-> 		ret = fgetc(stream);
#   90|   		if (ret == EOF) {
#   91|   			if (ferror(stream)) {

Error: COMPILER_WARNING (CWE-126): [#def66]
babeltrace-1.5.11/include/babeltrace/compat/string.h:58:16: warning[-Wstringop-overread]: 'strndup' specified bound 255 exceeds source size 64
#   58 |         return strndup(s, n);
#      |                ^~~~~~~~~~~~~
babeltrace-1.5.11/formats/lttng-live/lttng-live.h:30: included_from: Included from here.
babeltrace-1.5.11/formats/lttng-live/lttng-live-comm.c:57: included_from: Included from here.
babeltrace-1.5.11/formats/lttng-live/lttng-viewer-abi.h: scope_hint: In function 'lttng_live_list_sessions'
babeltrace-1.5.11/formats/lttng-live/lttng-viewer-abi.h:113:14: note: source object allocated here
#  113 |         char hostname[LTTNG_VIEWER_HOST_NAME_MAX];
#      |              ^~~~~~~~
#   56|   char *bt_strndup(const char *s, size_t n)
#   57|   {
#   58|-> 	return strndup(s, n);
#   59|   }
#   60|   #else

Error: COMPILER_WARNING (CWE-126): [#def67]
babeltrace-1.5.11/include/babeltrace/compat/string.h:58:16: warning[-Wstringop-overread]: 'strndup' specified bound 255 exceeds source size 64
#   56|   char *bt_strndup(const char *s, size_t n)
#   57|   {
#   58|-> 	return strndup(s, n);
#   59|   }
#   60|   #else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
babeltrace-1.5.11/include/babeltrace/compat/uuid.h:38:9: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_fp’
babeltrace-1.5.11/converter/babeltrace-log.c:386:5: enter_function: entry to ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:394:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:400:13: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:400:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:405:15: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:406:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
babeltrace-1.5.11/converter/babeltrace-log.c:411:15: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:412:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:416:18: call_function: inlined call to ‘bt_dirfd’ from ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:417:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:422:14: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:424:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:429:23: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:431:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:435:23: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:435:23: acquire_memory: allocated here
babeltrace-1.5.11/converter/babeltrace-log.c:436:12: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/converter/babeltrace-log.c:441:9: call_function: inlined call to ‘bt_uuid_generate’ from ‘main’
#   36|   int bt_uuid_generate(unsigned char *uuid_out)
#   37|   {
#   38|-> 	uuid_generate(uuid_out);
#   39|   	return 0;
#   40|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
babeltrace-1.5.11/include/babeltrace/compat/uuid.h:68:9: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_fp’
babeltrace-1.5.11/converter/babeltrace-log.c:386:5: enter_function: entry to ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:394:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:400:13: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:400:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:405:15: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:406:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
babeltrace-1.5.11/converter/babeltrace-log.c:411:15: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:412:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:416:18: call_function: inlined call to ‘bt_dirfd’ from ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:417:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:422:14: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:424:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:429:23: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:431:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/converter/babeltrace-log.c:435:23: branch_false: ...to here
babeltrace-1.5.11/converter/babeltrace-log.c:435:23: acquire_memory: allocated here
babeltrace-1.5.11/converter/babeltrace-log.c:436:12: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/converter/babeltrace-log.c:441:9: call_function: inlined call to ‘bt_uuid_generate’ from ‘main’
babeltrace-1.5.11/converter/babeltrace-log.c:442:9: call_function: calling ‘print_metadata’ from ‘main’
#   66|   int bt_uuid_unparse(const unsigned char *uuid_in, char *str_out)
#   67|   {
#   68|-> 	uuid_unparse(uuid_in, str_out);
#   69|   	return 0;
#   70|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
babeltrace-1.5.11/include/babeltrace/compat/uuid.h:82:16: warning[-Wanalyzer-malloc-leak]: leak of 'open_memstream(buf, & size)'
babeltrace-1.5.11/formats/ctf/ctf.c:2680:5: enter_function: entry to 'ctf_append_trace_metadata'
babeltrace-1.5.11/formats/ctf/ctf.c:2687:12: branch_false: following 'false' branch...
babeltrace-1.5.11/formats/ctf/ctf.c:2689:15: branch_false: ...to here
babeltrace-1.5.11/formats/ctf/ctf.c:2689:15: call_function: calling 'ctf_trace_metadata_read' from 'ctf_append_trace_metadata'
#   80|   		const unsigned char *uuid_b)
#   81|   {
#   82|-> 	return uuid_compare(uuid_a, uuid_b);
#   83|   }
#   84|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
babeltrace-1.5.11/lib/bin-info.c:205:14: warning[-Wanalyzer-malloc-leak]: leak of 'bin_dir'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:382:19: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  203|   	}
#  204|   
#  205|-> 	fd = open(path, O_RDONLY);
#  206|   	if (fd < 0) {
#  207|   		fd = -errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
babeltrace-1.5.11/lib/bin-info.c:205:14: warning[-Wanalyzer-malloc-leak]: leak of 'path'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:393:16: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  203|   	}
#  204|   
#  205|-> 	fd = open(path, O_RDONLY);
#  206|   	if (fd < 0) {
#  207|   		fd = -errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def73]
babeltrace-1.5.11/lib/bin-info.c:211:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path, 0)'
babeltrace-1.5.11/lib/bin-info.c:201:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:205:14: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:205:14: acquire_resource: opened here
babeltrace-1.5.11/lib/bin-info.c:206:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:211:22: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:211:22: danger: 'open(path, 0)' leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  209|   	}
#  210|   
#  211|-> 	dwarf_info = dwarf_begin(fd, DWARF_C_READ);
#  212|   	if (!dwarf_info) {
#  213|   		goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
babeltrace-1.5.11/lib/bin-info.c:211:22: warning[-Wanalyzer-malloc-leak]: leak of 'bin_dir'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:382:19: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  209|   	}
#  210|   
#  211|-> 	dwarf_info = dwarf_begin(fd, DWARF_C_READ);
#  212|   	if (!dwarf_info) {
#  213|   		goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
babeltrace-1.5.11/lib/bin-info.c:211:22: warning[-Wanalyzer-malloc-leak]: leak of 'path'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:393:16: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  209|   	}
#  210|   
#  211|-> 	dwarf_info = dwarf_begin(fd, DWARF_C_READ);
#  212|   	if (!dwarf_info) {
#  213|   		goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
babeltrace-1.5.11/lib/bin-info.c:220:14: warning[-Wanalyzer-malloc-leak]: leak of 'bin_dir'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:382:19: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  218|   	 * executable's object file contains no DWARF info.
#  219|   	 */
#  220|-> 	cu = bt_dwarf_cu_create(dwarf_info);
#  221|   	if (!cu) {
#  222|   		goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
babeltrace-1.5.11/lib/bin-info.c:220:14: warning[-Wanalyzer-malloc-leak]: leak of 'path'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:393:16: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  218|   	 * executable's object file contains no DWARF info.
#  219|   	 */
#  220|-> 	cu = bt_dwarf_cu_create(dwarf_info);
#  221|   	if (!cu) {
#  222|   		goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
babeltrace-1.5.11/lib/bin-info.c:225:15: warning[-Wanalyzer-malloc-leak]: leak of 'bin_dir'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:382:19: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  223|   	}
#  224|   
#  225|-> 	ret = bt_dwarf_cu_next(cu);
#  226|   	if (ret) {
#  227|   		goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
babeltrace-1.5.11/lib/bin-info.c:225:15: warning[-Wanalyzer-malloc-leak]: leak of 'path'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:393:16: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  223|   	}
#  224|   
#  225|-> 	ret = bt_dwarf_cu_next(cu);
#  226|   	if (ret) {
#  227|   		goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
babeltrace-1.5.11/lib/bin-info.c:242:17: warning[-Wanalyzer-malloc-leak]: leak of 'bin_dir'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:382:19: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  240|   error:
#  241|   	if (fd >= 0) {
#  242|-> 		close(fd);
#  243|   		fd = -1;
#  244|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
babeltrace-1.5.11/lib/bin-info.c:242:17: warning[-Wanalyzer-malloc-leak]: leak of 'path'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:393:16: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  240|   error:
#  241|   	if (fd >= 0) {
#  242|-> 		close(fd);
#  243|   		fd = -1;
#  244|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
babeltrace-1.5.11/lib/bin-info.c:245:9: warning[-Wanalyzer-malloc-leak]: leak of 'bin_dir'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:382:19: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  243|   		fd = -1;
#  244|   	}
#  245|-> 	dwarf_end(dwarf_info);
#  246|   	g_free(dwarf_info);
#  247|   	free(cu);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
babeltrace-1.5.11/lib/bin-info.c:245:9: warning[-Wanalyzer-malloc-leak]: leak of 'path'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:393:16: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:402:13: return_function: returning to 'bin_info_set_dwarf_info_debug_link' from 'is_valid_debug_file'
babeltrace-1.5.11/lib/bin-info.c:433:15: call_function: calling 'bin_info_set_dwarf_info_from_path' from 'bin_info_set_dwarf_info_debug_link'
#  243|   		fd = -1;
#  244|   	}
#  245|-> 	dwarf_end(dwarf_info);
#  246|   	g_free(dwarf_info);
#  247|   	free(cu);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
babeltrace-1.5.11/lib/bin-info.c:335:14: warning[-Wanalyzer-malloc-leak]: leak of 'bin_dir'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:382:19: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
#  333|   	}
#  334|   
#  335|-> 	fd = open(path, O_RDONLY);
#  336|   	if (fd < 0) {
#  337|   		goto end_noclose;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
babeltrace-1.5.11/lib/bin-info.c:335:14: warning[-Wanalyzer-malloc-leak]: leak of 'path'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:393:16: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
#  333|   	}
#  334|   
#  335|-> 	fd = open(path, O_RDONLY);
#  336|   	if (fd < 0) {
#  337|   		goto end_noclose;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def86]
babeltrace-1.5.11/lib/bin-info.c:340:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path, 0)'
babeltrace-1.5.11/lib/bin-info.c:331:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:335:14: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:335:14: acquire_resource: opened here
babeltrace-1.5.11/lib/bin-info.c:336:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:340:15: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:340:15: danger: 'open(path, 0)' leaks here; was opened at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  338|   	}
#  339|   
#  340|-> 	ret = crc32(fd, &_crc);
#  341|   	if (ret) {
#  342|   		ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
babeltrace-1.5.11/lib/bin-info.c:340:15: warning[-Wanalyzer-malloc-leak]: leak of 'bin_dir'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:382:19: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
#  338|   	}
#  339|   
#  340|-> 	ret = crc32(fd, &_crc);
#  341|   	if (ret) {
#  342|   		ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
babeltrace-1.5.11/lib/bin-info.c:340:15: warning[-Wanalyzer-malloc-leak]: leak of 'path'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:393:16: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
#  338|   	}
#  339|   
#  340|-> 	ret = crc32(fd, &_crc);
#  341|   	if (ret) {
#  342|   		ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
babeltrace-1.5.11/lib/bin-info.c:349:9: warning[-Wanalyzer-malloc-leak]: leak of 'bin_dir'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:382:19: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
#  347|   
#  348|   end:
#  349|-> 	close(fd);
#  350|   end_noclose:
#  351|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
babeltrace-1.5.11/lib/bin-info.c:349:9: warning[-Wanalyzer-malloc-leak]: leak of 'path'
babeltrace-1.5.11/lib/bin-info.c:363:5: enter_function: entry to 'bin_info_set_dwarf_info_debug_link'
babeltrace-1.5.11/lib/bin-info.c:370:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:377:12: branch_false: following 'false' branch (when 'dir_name' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:382:26: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:383:12: branch_false: following 'false' branch (when 'bin_dir' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:387:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:393:16: acquire_memory: allocated here
babeltrace-1.5.11/lib/bin-info.c:394:12: branch_false: following 'false' branch (when 'path' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:399:9: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:402:13: call_function: calling 'is_valid_debug_file' from 'bin_info_set_dwarf_info_debug_link'
#  347|   
#  348|   end:
#  349|-> 	close(fd);
#  350|   end_noclose:
#  351|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def91]
babeltrace-1.5.11/lib/bin-info.c:504:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(*bin.elf_path, 0)'
babeltrace-1.5.11/lib/bin-info.c:493:12: branch_false: following 'false' branch (when 'bin' is non-NULL)...
babeltrace-1.5.11/lib/bin-info.c:497:23: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:497:18: acquire_resource: opened here
babeltrace-1.5.11/lib/bin-info.c:498:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/bin-info.c:504:20: branch_false: ...to here
babeltrace-1.5.11/lib/bin-info.c:504:20: danger: 'open(*bin.elf_path, 0)' leaks here; was opened at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  502|   	}
#  503|   
#  504|-> 	elf_file = elf_begin(elf_fd, ELF_C_READ, NULL);
#  505|   	if (!elf_file) {
#  506|   		printf_debug("elf_begin failed: %s\n", elf_errmsg(-1));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def92]
babeltrace-1.5.11/lib/debug-info.c:115:14: warning[-Wanalyzer-null-dereference]: dereference of NULL 'bin'
babeltrace-1.5.11/lib/debug-info.c:245:27: enter_function: entry to 'proc_debug_info_sources_get_entry'
babeltrace-1.5.11/lib/debug-info.c:253:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/debug-info.c:257:9: branch_false: ...to here
babeltrace-1.5.11/lib/debug-info.c:263:12: branch_false: following 'false' branch...
babeltrace-1.5.11/lib/debug-info.c:268:9: branch_false: ...to here
babeltrace-1.5.11/lib/debug-info.c:270:16: branch_true: following 'true' branch...
babeltrace-1.5.11/lib/debug-info.c:272:34: branch_true: ...to here
babeltrace-1.5.11/lib/debug-info.c:285:34: call_function: calling 'debug_info_source_create_from_bin' from 'proc_debug_info_sources_get_entry'
#  113|   
#  114|   	/* Can't retrieve src_loc from ELF, or could not find binary, skip. */
#  115|-> 	if (!bin->is_elf_only || !debug_info_src->func) {
#  116|   		/* Lookup source location */
#  117|   		ret = bin_info_lookup_source_location(bin, ip, &src_loc);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def93]
babeltrace-1.5.11/lib/iterator.c:140:25: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cfs'
babeltrace-1.5.11/lib/iterator.c:789:17: enter_function: entry to 'bt_iter_create'
babeltrace-1.5.11/lib/iterator.c:796:12: branch_false: following 'false' branch (when 'ctx' is non-NULL)...
babeltrace-1.5.11/lib/iterator.c:799:16: branch_false: ...to here
babeltrace-1.5.11/lib/iterator.c:800:15: call_function: calling 'bt_iter_init' from 'bt_iter_create'
#  138|   
#  139|   	stream_pos = &cfs->pos;
#  140|-> 	for (i = 0; i < stream_pos->packet_index->len; i++) {
#  141|   		index = &g_array_index(stream_pos->packet_index,
#  142|   				struct packet_index, i);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def94]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:67:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(metadata_path, 0)’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:67:17: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:67:17: danger: ‘open(metadata_path, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#   65|   
#   66|   	if (parser_output_fd == -1 || metadata_fd == -1) {
#   67|-> 		diag("Failed create temporary files for metadata parsing.");
#   68|   		ret = -1;
#   69|   		goto result;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def95]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:75:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(metadata_path, 0)’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:73:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:74:21: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:75:17: danger: ‘open(metadata_path, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#   73|   	if (pid) {
#   74|   		int status = 0;
#   75|-> 		waitpid(pid, &status, 0);
#   76|   		ret = WIFEXITED(status) ? WEXITSTATUS(status) : -1;
#   77|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def96]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:81:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(metadata_path, 0)’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:73:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:79:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:80:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:81:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:81:25: danger: ‘open(metadata_path, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#   79|   		ret = dup2(metadata_fd, STDIN_FILENO);
#   80|   		if (ret < 0) {
#   81|-> 			perror("# dup2 metadata_fd to STDIN");
#   82|   			goto result;
#   83|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def97]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:87:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(metadata_path, 0)’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:73:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:79:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:80:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:85:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:86:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:87:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:87:25: danger: ‘open(metadata_path, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#   85|   		ret = dup2(parser_output_fd, STDOUT_FILENO);
#   86|   		if (ret < 0) {
#   87|-> 			perror("# dup2 parser_output_fd to STDOUT");
#   88|   			goto result;
#   89|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def98]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:87:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:73:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:79:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:79:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:80:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:85:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:86:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:87:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:87:25: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
#   85|   		ret = dup2(parser_output_fd, STDOUT_FILENO);
#   86|   		if (ret < 0) {
#   87|-> 			perror("# dup2 parser_output_fd to STDOUT");
#   88|   			goto result;
#   89|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def99]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:92:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(metadata_path, 0)’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:73:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:79:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:80:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:85:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:86:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:91:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:92:20: danger: ‘open(metadata_path, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#   90|   
#   91|   		ret = dup2(parser_output_fd, STDERR_FILENO);
#   92|-> 		if (ret < 0) {
#   93|   			perror("# dup2 parser_output_fd to STDERR");
#   94|   			goto result;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:93:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(metadata_path, 0)’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:73:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:79:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:80:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:85:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:86:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:91:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:92:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:93:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:93:25: danger: ‘open(metadata_path, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#   91|   		ret = dup2(parser_output_fd, STDERR_FILENO);
#   92|   		if (ret < 0) {
#   93|-> 			perror("# dup2 parser_output_fd to STDERR");
#   94|   			goto result;
#   95|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def101]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:93:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:73:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:79:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:79:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:80:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:85:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:86:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:91:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:92:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:93:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:93:25: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/6)
#   91|   		ret = dup2(parser_output_fd, STDERR_FILENO);
#   92|   		if (ret < 0) {
#   93|-> 			perror("# dup2 parser_output_fd to STDERR");
#   94|   			goto result;
#   95|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def102]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:98:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:73:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:79:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:80:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:85:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:86:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:91:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:91:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:92:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:97:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:98:17: danger: ‘ret’ leaks here; was opened at [(11)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/10)
#   96|   
#   97|   		execl(parser_path, parser_path, (char *) NULL);
#   98|-> 		perror("# Could not launch the ctf metadata parser process");
#   99|   		exit(-1);
#  100|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def103]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:102:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘metadata_fd’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:67:17: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:102:9: danger: ‘metadata_fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
#  100|   	}
#  101|   result:
#  102|-> 	ok(ret == 0, "Metadata string is valid");
#  103|   
#  104|   	if (ret && metadata_fd >= 0 && parser_output_fd >= 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def104]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:102:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(metadata_path, 0)’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:73:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:74:21: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:76:23: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:76:43: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:102:9: branch_true: following ‘true’ branch (when ‘ret == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:102:9: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:102:9: danger: ‘open(metadata_path, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  100|   	}
#  101|   result:
#  102|-> 	ok(ret == 0, "Metadata string is valid");
#  103|   
#  104|   	if (ret && metadata_fd >= 0 && parser_output_fd >= 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:118:25: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:109:31: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_true: following ‘true’ branch (when ‘parser_output_fp’ is NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:118:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:118:25: danger: ‘metadata_fp’ leaks here; was allocated at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4)
#  116|   		parser_output_fp = fdopen(parser_output_fd, "r");
#  117|   		if (!parser_output_fp) {
#  118|-> 			perror("fdopen on parser_output_fd");
#  119|   			goto close_fp;
#  120|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def106]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:125:25: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:109:31: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:125:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:125:25: danger: ‘metadata_fp’ leaks here; was allocated at [(5)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/4)
#  123|   		line = malloc(len);
#  124|   		if (!line) {
#  125|-> 			diag("malloc failure");
#  126|   		}
#  127|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:125:25: warning[-Wanalyzer-malloc-leak]: leak of ‘parser_output_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:125:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:125:25: danger: ‘parser_output_fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/6)
#  123|   		line = malloc(len);
#  124|   		if (!line) {
#  125|-> 			diag("malloc failure");
#  126|   		}
#  127|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: danger: ‘line’ leaks here; was allocated at [(9)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/8)
#  126|   		}
#  127|   
#  128|-> 		rewind(metadata_fp);
#  129|   
#  130|   		/* Output the metadata and parser output as diagnostic */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:109:31: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: danger: ‘metadata_fp’ leaks here; was allocated at [(5)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/4)
#  126|   		}
#  127|   
#  128|-> 		rewind(metadata_fp);
#  129|   
#  130|   		/* Output the metadata and parser output as diagnostic */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def110]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: warning[-Wanalyzer-malloc-leak]: leak of ‘parser_output_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: danger: ‘parser_output_fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/6)
#  126|   		}
#  127|   
#  128|-> 		rewind(metadata_fp);
#  129|   
#  130|   		/* Output the metadata and parser output as diagnostic */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:132:25: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:50:6: enter_function: entry to ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: call_function: calling ‘bt_getline’ from ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: return_function: returning to ‘validate_metadata’ from ‘bt_getline’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:132:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:132:25: danger: ‘line’ leaks here; was allocated at [(10)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/9)
#  130|   		/* Output the metadata and parser output as diagnostic */
#  131|   		while (bt_getline(&line, &len, metadata_fp) > 0) {
#  132|-> 			diag("%s", line);
#  133|   		}
#  134|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:132:25: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:50:6: enter_function: entry to ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:109:31: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: call_function: calling ‘bt_getline’ from ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: return_function: returning to ‘validate_metadata’ from ‘bt_getline’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:132:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:132:25: danger: ‘metadata_fp’ leaks here; was allocated at [(6)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/5)
#  130|   		/* Output the metadata and parser output as diagnostic */
#  131|   		while (bt_getline(&line, &len, metadata_fp) > 0) {
#  132|-> 			diag("%s", line);
#  133|   		}
#  134|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:132:25: warning[-Wanalyzer-malloc-leak]: leak of ‘parser_output_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:50:6: enter_function: entry to ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: call_function: calling ‘bt_getline’ from ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: return_function: returning to ‘validate_metadata’ from ‘bt_getline’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:132:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:132:25: danger: ‘parser_output_fp’ leaks here; was allocated at [(8)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/7)
#  130|   		/* Output the metadata and parser output as diagnostic */
#  131|   		while (bt_getline(&line, &len, metadata_fp) > 0) {
#  132|-> 			diag("%s", line);
#  133|   		}
#  134|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:135:17: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:50:6: enter_function: entry to ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: call_function: calling ‘bt_getline’ from ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: return_function: returning to ‘validate_metadata’ from ‘bt_getline’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:135:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:135:17: danger: ‘line’ leaks here; was allocated at [(10)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/9)
#  133|   		}
#  134|   
#  135|-> 		rewind(parser_output_fp);
#  136|   		while (bt_getline(&line, &len, parser_output_fp) > 0) {
#  137|   			diag("%s", line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:135:17: warning[-Wanalyzer-malloc-leak]: leak of ‘metadata_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:50:6: enter_function: entry to ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:109:31: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: call_function: calling ‘bt_getline’ from ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: return_function: returning to ‘validate_metadata’ from ‘bt_getline’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:135:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:135:17: danger: ‘metadata_fp’ leaks here; was allocated at [(6)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/5)
#  133|   		}
#  134|   
#  135|-> 		rewind(parser_output_fp);
#  136|   		while (bt_getline(&line, &len, parser_output_fp) > 0) {
#  137|   			diag("%s", line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:135:17: warning[-Wanalyzer-malloc-leak]: leak of ‘parser_output_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:50:6: enter_function: entry to ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:110:20: branch_false: following ‘false’ branch (when ‘metadata_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:116:36: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:117:20: branch_false: following ‘false’ branch (when ‘parser_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:123:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:124:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:128:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: call_function: calling ‘bt_getline’ from ‘validate_metadata’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: return_function: returning to ‘validate_metadata’ from ‘bt_getline’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:131:24: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:135:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:135:17: danger: ‘parser_output_fp’ leaks here; was allocated at [(8)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/7)
#  133|   		}
#  134|   
#  135|-> 		rewind(parser_output_fp);
#  136|   		while (bt_getline(&line, &len, parser_output_fp) > 0) {
#  137|   			diag("%s", line);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def117]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:155:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘metadata_fd’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:154:12: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:154:12: branch_true: following ‘true’ branch (when ‘parser_output_fd >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:155:21: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:155:21: danger: ‘metadata_fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/2)
#  153|   
#  154|   	if (parser_output_fd >= 0) {
#  155|-> 		if (close(parser_output_fd)) {
#  156|   			diag("close error");
#  157|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def118]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:156:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘metadata_fd’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:66:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:72:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:154:12: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:154:12: branch_true: following ‘true’ branch (when ‘parser_output_fd >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:155:21: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:155:20: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:156:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:156:25: danger: ‘metadata_fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/2)
#  154|   	if (parser_output_fd >= 0) {
#  155|   		if (close(parser_output_fd)) {
#  156|-> 			diag("close error");
#  157|   		}
#  158|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def119]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:160:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘metadata_fd’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:13: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:104:13: branch_false: following ‘false’ branch (when ‘parser_output_fd < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:159:12: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:159:12: branch_true: following ‘true’ branch (when ‘metadata_fd >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:160:21: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:160:21: danger: ‘metadata_fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/2)
#  158|   	}
#  159|   	if (metadata_fd >= 0) {
#  160|-> 		if (close(metadata_fd)) {
#  161|   			diag("close error");
#  162|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def120]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:164:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘metadata_fd’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:56:12: branch_false: following ‘false’ branch (when ‘metadata_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:61:28: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:62:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:159:12: branch_false: following ‘false’ branch (when ‘metadata_fd < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:164:1: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:164:1: danger: ‘metadata_fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/2)
#  162|   		}
#  163|   	}
#  164|-> }
#  165|   
#  166|   void validate_trace(char *parser_path, char *trace_path)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def121]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:200:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:172:12: branch_false: following ‘false’ branch (when ‘trace_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:177:32: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:180:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:186:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:187:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:193:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:198:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:199:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:200:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:200:25: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/6)
#  198|   		ret = dup2(babeltrace_output_fd, STDERR_FILENO);
#  199|   		if (ret < 0) {
#  200|-> 			perror("# dup2 babeltrace_output_fd to STDERR");
#  201|   			goto result;
#  202|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def122]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:205:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:172:12: branch_false: following ‘false’ branch (when ‘trace_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:177:32: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:180:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:186:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:187:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:193:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:198:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:199:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:204:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:205:17: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/6)
#  203|   
#  204|   		execl(parser_path, parser_path, trace_path, (char *) NULL);
#  205|-> 		perror("# Could not launch the babeltrace process");
#  206|   		exit(-1);
#  207|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def123]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:172:12: branch_false: following ‘false’ branch (when ‘trace_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:177:32: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:180:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:186:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:187:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:193:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:198:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:199:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:200:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: following ‘false’ branch (when ‘ret != 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/6)
#  207|   	}
#  208|   result:
#  209|-> 	ok(ret == 0, "Babeltrace could read the resulting trace");
#  210|   
#  211|   	if (ret && babeltrace_output_fd >= 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def124]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:218:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:172:12: branch_false: following ‘false’ branch (when ‘trace_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:177:32: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:180:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:186:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:187:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:193:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:198:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:199:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:200:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: following ‘false’ branch (when ‘ret != 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:211:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:213:24: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_true: following ‘true’ branch (when ‘babeltrace_output_fp’ is NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:218:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:218:25: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/6)
#  216|   		babeltrace_output_fp = fdopen(babeltrace_output_fd, "r");
#  217|   		if (!babeltrace_output_fp) {
#  218|-> 			perror("fdopen on babeltrace_output_fd");
#  219|   			goto close_fp;
#  220|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def125]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:225:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:172:12: branch_false: following ‘false’ branch (when ‘trace_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:177:32: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:180:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:186:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:187:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:193:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:198:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:199:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:200:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: following ‘false’ branch (when ‘ret != 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:211:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:213:24: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:224:20: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:225:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:225:25: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/6)
#  223|   		line = malloc(len);
#  224|   		if (!line) {
#  225|-> 			diag("malloc error");
#  226|   		}
#  227|   		rewind(babeltrace_output_fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def126]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:225:25: warning[-Wanalyzer-malloc-leak]: leak of ‘babeltrace_output_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:211:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:213:24: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:216:40: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:224:20: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:225:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:225:25: danger: ‘babeltrace_output_fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/2)
#  223|   		line = malloc(len);
#  224|   		if (!line) {
#  225|-> 			diag("malloc error");
#  226|   		}
#  227|   		rewind(babeltrace_output_fp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def127]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:172:12: branch_false: following ‘false’ branch (when ‘trace_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:177:32: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:180:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:186:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:187:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:193:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:198:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:199:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:200:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: following ‘false’ branch (when ‘ret != 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:211:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:213:24: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:224:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/6)
#  225|   			diag("malloc error");
#  226|   		}
#  227|-> 		rewind(babeltrace_output_fp);
#  228|   		while (bt_getline(&line, &len, babeltrace_output_fp) > 0) {
#  229|   			diag("%s", line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def128]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: warning[-Wanalyzer-malloc-leak]: leak of ‘babeltrace_output_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:211:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:213:24: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:216:40: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:224:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: danger: ‘babeltrace_output_fp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/2)
#  225|   			diag("malloc error");
#  226|   		}
#  227|-> 		rewind(babeltrace_output_fp);
#  228|   		while (bt_getline(&line, &len, babeltrace_output_fp) > 0) {
#  229|   			diag("%s", line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:211:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:213:24: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:224:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: danger: ‘line’ leaks here; was allocated at [(5)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/4)
#  225|   			diag("malloc error");
#  226|   		}
#  227|-> 		rewind(babeltrace_output_fp);
#  228|   		while (bt_getline(&line, &len, babeltrace_output_fp) > 0) {
#  229|   			diag("%s", line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:229:25: warning[-Wanalyzer-malloc-leak]: leak of ‘babeltrace_output_fp’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:166:6: enter_function: entry to ‘validate_trace’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:211:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:213:24: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:216:40: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:224:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:228:24: call_function: calling ‘bt_getline’ from ‘validate_trace’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:228:24: return_function: returning to ‘validate_trace’ from ‘bt_getline’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:228:24: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:229:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:229:25: danger: ‘babeltrace_output_fp’ leaks here; was allocated at [(4)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/3)
#  227|   		rewind(babeltrace_output_fp);
#  228|   		while (bt_getline(&line, &len, babeltrace_output_fp) > 0) {
#  229|-> 			diag("%s", line);
#  230|   		}
#  231|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:229:25: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:166:6: enter_function: entry to ‘validate_trace’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:211:12: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:213:24: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:223:24: acquire_memory: allocated here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:224:20: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:227:17: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:228:24: call_function: calling ‘bt_getline’ from ‘validate_trace’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:228:24: return_function: returning to ‘validate_trace’ from ‘bt_getline’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:228:24: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:229:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:229:25: danger: ‘line’ leaks here; was allocated at [(6)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/5)
#  227|   		rewind(babeltrace_output_fp);
#  228|   		while (bt_getline(&line, &len, babeltrace_output_fp) > 0) {
#  229|-> 			diag("%s", line);
#  230|   		}
#  231|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def132]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:242:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:172:12: branch_false: following ‘false’ branch (when ‘trace_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:177:32: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:180:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:186:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:187:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:193:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:198:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:199:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:200:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: following ‘false’ branch (when ‘ret != 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_true: following ‘true’ branch (when ‘babeltrace_output_fp’ is NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:218:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:234:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is NULL)...
 branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:241:12: branch_true: following ‘true’ branch (when ‘babeltrace_output_fd >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:242:21: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:242:21: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/6)
#  240|   
#  241|   	if (babeltrace_output_fd >= 0) {
#  242|-> 		if (close(babeltrace_output_fd)) {
#  243|   			diag("close error");
#  244|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def133]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:243:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:172:12: branch_false: following ‘false’ branch (when ‘trace_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:177:32: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:180:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:186:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:187:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:193:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:198:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:199:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:200:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: following ‘false’ branch (when ‘ret != 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:217:20: branch_true: following ‘true’ branch (when ‘babeltrace_output_fp’ is NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:218:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:234:20: branch_false: following ‘false’ branch (when ‘babeltrace_output_fp’ is NULL)...
 branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:241:12: branch_true: following ‘true’ branch (when ‘babeltrace_output_fd >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:242:21: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:242:20: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:243:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:243:25: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/6)
#  241|   	if (babeltrace_output_fd >= 0) {
#  242|   		if (close(babeltrace_output_fd)) {
#  243|-> 			diag("close error");
#  244|   		}
#  245|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def134]
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:246:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:172:12: branch_false: following ‘false’ branch (when ‘trace_path’ is non-NULL)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:177:32: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:180:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:186:21: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:187:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:192:23: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:193:20: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:198:23: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:199:20: branch_true: following ‘true’ branch (when ‘ret < 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:200:25: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: following ‘false’ branch (when ‘ret != 0’)...
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:209:9: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_ctf_writer.c:246:1: danger: ‘ret’ leaks here; was opened at [(7)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/6)
#  244|   		}
#  245|   	}
#  246|-> }
#  247|   
#  248|   void append_simple_event(struct bt_ctf_stream_class *stream_class,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def135]
babeltrace-1.5.11/tests/lib/test_dwarf.c:46:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
babeltrace-1.5.11/tests/lib/test_dwarf.c:45:14: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_dwarf.c:46:9: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_dwarf.c:46:9: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_dwarf.c:46:9: danger: ‘open(&path, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   44|   
#   45|   	fd = open(path, O_RDONLY);
#   46|-> 	ok(fd >= 0, "Open DWARF file %s", path);
#   47|   	if (fd < 0) {
#   48|   	        exit(EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def136]
babeltrace-1.5.11/tests/lib/test_dwarf.c:50:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
babeltrace-1.5.11/tests/lib/test_dwarf.c:45:14: acquire_resource: opened here
babeltrace-1.5.11/tests/lib/test_dwarf.c:46:9: branch_true: following ‘true’ branch...
babeltrace-1.5.11/tests/lib/test_dwarf.c:46:9: branch_true: ...to here
babeltrace-1.5.11/tests/lib/test_dwarf.c:47:12: branch_false: following ‘false’ branch...
babeltrace-1.5.11/tests/lib/test_dwarf.c:50:22: branch_false: ...to here
babeltrace-1.5.11/tests/lib/test_dwarf.c:50:22: danger: ‘open(&path, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   48|   	        exit(EXIT_FAILURE);
#   49|   	}
#   50|-> 	dwarf_info = dwarf_begin(fd, DWARF_C_READ);
#   51|   	ok(dwarf_info != NULL, "dwarf_begin successful");
#   52|   	cu = bt_dwarf_cu_create(dwarf_info);

Error: GCC_ANALYZER_WARNING (CWE-465): [#def137]
babeltrace-1.5.11/types/types.c:215:16: warning[-Wanalyzer-deref-before-check]: check of 'scope' for NULL after already dereferencing it
babeltrace-1.5.11/types/types.c:187:9: enter_function: entry to 'bt_lookup_path_definition'
babeltrace-1.5.11/types/types.c:196:9: call_function: calling 'is_path_child_of' from 'bt_lookup_path_definition'
babeltrace-1.5.11/types/types.c:196:9: return_function: returning to 'bt_lookup_path_definition' from 'is_path_child_of'
babeltrace-1.5.11/types/types.c:196:9: branch_true: following 'true' branch...
babeltrace-1.5.11/types/types.c:197:9: branch_true: ...to here
babeltrace-1.5.11/types/types.c:197:9: branch_true: following 'true' branch...
babeltrace-1.5.11/types/types.c:203:13: branch_true: ...to here
babeltrace-1.5.11/types/types.c:203:12: branch_false: following 'false' branch...
 branch_false: ...to here
babeltrace-1.5.11/types/types.c:215:16: danger: pointer 'scope' is checked for NULL here but it was already dereferenced at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  213|   	}
#  214|   
#  215|-> 	while (scope) {
#  216|   		if (is_path_child_of(cur_path, scope->scope_path) &&
#  217|   		    cur_path->len - scope->scope_path->len == 1) {

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-121.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-gcc-latest-x86_64
project-namebabeltrace-1.5.11-15.fc44
store-results-to/tmp/tmpq3vobpfz/babeltrace-1.5.11-15.fc44.tar.xz
time-created2025-10-28 17:24:00
time-finished2025-10-28 17:26:33
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpq3vobpfz/babeltrace-1.5.11-15.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpq3vobpfz/babeltrace-1.5.11-15.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9