leptonica-1.87.0-1.fc44

List of Findings

Error: COMPILER_WARNING (CWE-563): [#def1]
leptonica-1.87.0/prog/autogen.137.h:54:20: warning[-Wunused-variable]: ‘l_strdata_0’ defined but not used
#   54 | static const char *l_strdata_0 =
#      |                    ^~~~~~~~~~~
#   52|   /*                         Serialized strings                          */
#   53|   /*---------------------------------------------------------------------*/
#   54|-> static const char *l_strdata_0 =
#   55|       "eJy1mgtUE1cax+9kQh4wIREQBhAyQCoPFYd3UEjCQ0RtC1prbbUyaBWsVvDRFRRIAjSgSwta"
#   56|       "16q1Ilq7PrpdtN3W1q1OHCtUEcTXqu0KwSpY2yWIj4Ah2aA1xJ3NIeM5cg6gnJwzv9x78/99"

Error: COMPILER_WARNING (CWE-563): [#def2]
leptonica-1.87.0/prog/autogentest2.c:42: included_from: Included from here.
leptonica-1.87.0/prog/autogen.137.h:155:20: warning[-Wunused-variable]: ‘l_strdata_1’ defined but not used
#  155 | static const char *l_strdata_1 =
#      |                    ^~~~~~~~~~~
#  153|       "xunS9L22LP8FbV4rjQ==";
#  154|   
#  155|-> static const char *l_strdata_1 =
#  156|       "eJy1nAdUE1n7hyckJICBhCIEKQlFQEVJRCmCJEBoNooNG4YioqKCCuKKKQRCF0SKWAARFEUE"
#  157|       "xFXswQRBRQHLisoqAdsqSmLBKIH546qB7z9fzsfsOetRgzk5Z55n5s79vfedG9X81sUFk5as"

Error: COMPILER_WARNING (CWE-563): [#def3]
leptonica-1.87.0/prog/cleanpdf.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/cleanpdf.c:139:45: warning[-Wunused-variable]: unused variable ‘render_res’
#  139 | l_int32  res, contrast, rotation, opensize, render_res;
#      |                                             ^~~~~~~~~~
#  137|   {
#  138|   char    *basedir, *title, *fileout;
#  139|-> l_int32  res, contrast, rotation, opensize, render_res;
#  140|   SARRAY  *safiles;
#  141|   

Error: COMPILER_WARNING (CWE-563): [#def4]
leptonica-1.87.0/prog/compresspdf.c:137:12: warning[-Wunused-variable]: unused variable ‘buf’
#  137 | char       buf[256];
#      |            ^~~
#  135|                char **argv)
#  136|   {
#  137|-> char       buf[256];
#  138|   char      *basedir, *title, *fileout;
#  139|   l_int32    imres, render_res, onebit, savecolor, quality;

Error: COMPILER_WARNING (CWE-563): [#def5]
leptonica-1.87.0/prog/compresspdf.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/compresspdf.c:139:19: warning[-Wunused-variable]: unused variable ‘render_res’
#  139 | l_int32    imres, render_res, onebit, savecolor, quality;
#      |                   ^~~~~~~~~~
#  137|   char       buf[256];
#  138|   char      *basedir, *title, *fileout;
#  139|-> l_int32    imres, render_res, onebit, savecolor, quality;
#  140|   l_float32  scalefactor;
#  141|   SARRAY    *safiles;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def6]
leptonica-1.87.0/prog/convertsegfilestopdf.c:147:8: warning[-Wanalyzer-deref-before-check]: check of ‘maskdir’ for NULL after already dereferencing it
leptonica-1.87.0/prog/convertsegfilestopdf.c:88:8: branch_false: following ‘false’ branch (when ‘argc == 12’)...
leptonica-1.87.0/prog/convertsegfilestopdf.c:117:5: branch_false: ...to here
leptonica-1.87.0/prog/convertsegfilestopdf.c:129:8: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/prog/convertsegfilestopdf.c:129:8: branch_true: ...to here
leptonica-1.87.0/prog/convertsegfilestopdf.c:131:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
leptonica-1.87.0/prog/convertsegfilestopdf.c:133:10: branch_false: ...to here
leptonica-1.87.0/prog/convertsegfilestopdf.c:133:8: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/prog/convertsegfilestopdf.c:133:8: branch_true: ...to here
leptonica-1.87.0/prog/convertsegfilestopdf.c:135:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/prog/convertsegfilestopdf.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/prog/convertsegfilestopdf.c:141:8: branch_false: ...to here
leptonica-1.87.0/prog/convertsegfilestopdf.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/prog/convertsegfilestopdf.c:143:10: branch_false: ...to here
leptonica-1.87.0/prog/convertsegfilestopdf.c:143:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
leptonica-1.87.0/prog/convertsegfilestopdf.c:146:5: branch_false: ...to here
leptonica-1.87.0/prog/convertsegfilestopdf.c:147:8: danger: pointer ‘maskdir’ is checked for NULL here but it was already dereferenced at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  145|   
#  146|       setLeptDebugOK(1);
#  147|->     if (maskdir)  /* use this; ignore any input boxaafile */
#  148|           baa = convertNumberedMasksToBoxaa(maskdir, masksubstr, 0, 0);
#  149|       else if (strcmp(boxaafile, "skip") != 0) {  /* use the boxaafile */

Error: COMPILER_WARNING (CWE-563): [#def7]
leptonica-1.87.0/prog/croppdf.c:111:12: warning[-Wunused-variable]: unused variable ‘buf’
#  111 | char       buf[256];
#      |            ^~~
#  109|                char **argv)
#  110|   {
#  111|-> char       buf[256];
#  112|   char      *basedir, *title, *fileout;
#  113|   l_int32    lrclear, tbclear, edgeclean, lrborder, tbborder;

Error: COMPILER_WARNING (CWE-563): [#def8]
leptonica-1.87.0/prog/croppdf.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/croppdf.c:114:24: warning[-Wunused-variable]: unused variable ‘render_res’
#  114 | l_int32    printwiden, render_res;
#      |                        ^~~~~~~~~~
#  112|   char      *basedir, *title, *fileout;
#  113|   l_int32    lrclear, tbclear, edgeclean, lrborder, tbborder;
#  114|-> l_int32    printwiden, render_res;
#  115|   l_float32  maxwiden;
#  116|   SARRAY    *safiles;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def9]
leptonica-1.87.0/prog/findbinding.c:135:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ymax’
leptonica-1.87.0/prog/findbinding.c:60:8: branch_false: following ‘false’ branch (when ‘argc == 1’)...
leptonica-1.87.0/prog/findbinding.c:63:5: branch_false: ...to here
leptonica-1.87.0/prog/findbinding.c:116:22: branch_false: following ‘false’ branch (when ‘y > yend’)...
leptonica-1.87.0/prog/findbinding.c:135:5: branch_false: ...to here
leptonica-1.87.0/prog/findbinding.c:135:5: danger: use of uninitialized value ‘ymax’ here
#  133|           /* Plot the windowed variance as a function of the y-value
#  134|            * of the window location */
#  135|->     lept_stderr("maxvar = %f, ymax = %d\n", maxvar, ymax);
#  136|       gplotSimple1(na1, GPLOT_PNG, "/tmp/lept/binding/root", NULL);
#  137|       pix7 = pixRead("/tmp/lept/binding/root.png");

Error: COMPILER_WARNING (CWE-457): [#def10]
leptonica-1.87.0/prog/findbinding.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/findbinding.c:135:5: warning[-Wmaybe-uninitialized]: ‘ymax’ may be used uninitialized
#  135 |     lept_stderr("maxvar = %f, ymax = %d\n", maxvar, ymax);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/prog/findbinding.c:53:35: note: ‘ymax’ was declared here
#   53 | l_int32    w, h, ystart, yend, y, ymax, ymid, i, window, sum1, sum2, rankx;
#      |                                   ^~~~
#  133|           /* Plot the windowed variance as a function of the y-value
#  134|            * of the window location */
#  135|->     lept_stderr("maxvar = %f, ymax = %d\n", maxvar, ymax);
#  136|       gplotSimple1(na1, GPLOT_PNG, "/tmp/lept/binding/root", NULL);
#  137|       pix7 = pixRead("/tmp/lept/binding/root.png");

Error: COMPILER_WARNING (CWE-563): [#def11]
leptonica-1.87.0/prog/hashtest.c: scope_hint: In function ‘BuildShortStrings’
leptonica-1.87.0/prog/hashtest.c:261:11: warning[-Wunused-variable]: unused variable ‘hash’
#  261 | l_uint64  hash;
#      |           ^~~~
#  259|   char      buf[64];
#  260|   l_int32   i, j, k, l, m;
#  261|-> l_uint64  hash;
#  262|   SARRAY   *sa;
#  263|   

Error: COMPILER_WARNING: [#def12]
leptonica-1.87.0/prog/messagetest.c: scope_hint: In function ‘TestMessageControl’
leptonica-1.87.0/prog/messagetest.c:138:10: warning[-Wunused-but-set-variable=]: variable ‘orig_severity’ set but not used
#  138 | l_int32  orig_severity;
#      |          ^~~~~~~~~~~~~
#  136|   void TestMessageControl(l_int32  severity)
#  137|   {
#  138|-> l_int32  orig_severity;
#  139|   
#  140|       setMsgSeverity(DEFAULT_SEVERITY);

Error: COMPILER_WARNING: [#def13]
leptonica-1.87.0/prog/messagetest.c: scope_hint: In function ‘TestStderrRedirect’
leptonica-1.87.0/prog/messagetest.c:160:7: warning[-Wunused-but-set-variable=]: variable ‘pix1’ set but not used
#  160 | PIX  *pix1;
#      |       ^~~~
#  158|   
#  159|   void TestStderrRedirect() {
#  160|-> PIX  *pix1;
#  161|   
#  162|           /* Output to stderr works */

Error: COMPILER_WARNING: [#def14]
leptonica-1.87.0/prog/overlap_reg.c: scope_hint: In function ‘boxaCombineOverlapsAlt’
leptonica-1.87.0/prog/overlap_reg.c:206:43: warning[-Wunused-but-set-variable=]: variable ‘niters’ set but not used
#  206 | l_int32  i, j, n1, n2, inter, interfound, niters;
#      |                                           ^~~~~~
#  204|   boxaCombineOverlapsAlt(BOXA  *boxas)
#  205|   {
#  206|-> l_int32  i, j, n1, n2, inter, interfound, niters;
#  207|   BOX     *box1, *box2, *box3;
#  208|   BOXA    *boxa1, *boxa2;

Error: COMPILER_WARNING: [#def15]
leptonica-1.87.0/prog/printimage.c:87:21: warning[-Wunused-but-set-variable=]: variable ‘ret’ set but not used
#   87 | l_int32    i, w, h, ret, index;
#      |                     ^~~
#   85|   char      *filein, *printer, *extra, *fname;
#   86|   char       buffer[512];
#   87|-> l_int32    i, w, h, ret, index;
#   88|   l_float32  scale;
#   89|   FILE      *fp;

Error: COMPILER_WARNING (CWE-563): [#def16]
leptonica-1.87.0/prog/printimage.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/printimage.c:89:12: warning[-Wunused-variable]: unused variable ‘fp’
#   89 | FILE      *fp;
#      |            ^~
#   87|   l_int32    i, w, h, ret, index;
#   88|   l_float32  scale;
#   89|-> FILE      *fp;
#   90|   PIX       *pixs, *pix1;
#   91|   SARRAY    *sa;

Error: COMPILER_WARNING (CWE-563): [#def17]
leptonica-1.87.0/prog/printsplitimage.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/printsplitimage.c:78:14: warning[-Wunused-variable]: unused variable ‘fp’
#   78 | FILE        *fp;
#      |              ^~
#   76|   l_int32      nx, ny, i, w, h, ws, hs, n, index;
#   77|   l_float32    scale;
#   78|-> FILE        *fp;
#   79|   PIX         *pixs, *pixt, *pixr;
#   80|   PIXA        *pixa;

Error: COMPILER_WARNING: [#def18]
leptonica-1.87.0/prog/rasteroptest.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/rasteroptest.c:59:22: warning[-Wunused-but-set-variable=]: variable ‘selectop’ set but not used
#   59 | l_int32  niters, op, selectop;
#      |                      ^~~~~~~~
#   57|   BOX     *box1, *box2;
#   58|   PIX     *pix1;
#   59|-> l_int32  niters, op, selectop;
#   60|   
#   61|       setLeptDebugOK(1);

Error: COMPILER_WARNING (CWE-1164): [#def19]
leptonica-1.87.0/prog/recog_bootnum1.c:281:7: warning[-Wunused-function]: ‘MakeBootnum2’ defined but not used
#  281 | PIXA *MakeBootnum2(void)
#      |       ^~~~~~~~~~~~
#  279|   
#  280|   
#  281|-> PIXA *MakeBootnum2(void)
#  282|   {
#  283|   char     *fname;

Error: COMPILER_WARNING (CWE-563): [#def20]
leptonica-1.87.0/prog/rotateorthtest1.c:49:26: warning[-Wunused-variable]: unused variable ‘pixt’
#   49 | PIX       *pixs, *pixd, *pixt;
#      |                          ^~~~
#   47|   {
#   48|   l_int32    dir;
#   49|-> PIX       *pixs, *pixd, *pixt;
#   50|   l_float32  pops;
#   51|   char      *filein, *fileout;

Error: COMPILER_WARNING (CWE-563): [#def21]
leptonica-1.87.0/prog/rotateorthtest1.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/rotateorthtest1.c:50:12: warning[-Wunused-variable]: unused variable ‘pops’
#   50 | l_float32  pops;
#      |            ^~~~
#   48|   l_int32    dir;
#   49|   PIX       *pixs, *pixd, *pixt;
#   50|-> l_float32  pops;
#   51|   char      *filein, *fileout;
#   52|   

Error: COMPILER_WARNING: [#def22]
leptonica-1.87.0/prog/rotatetest1.c:43:12: warning[-Wunused-but-set-variable=]: variable ‘angle’ set but not used
#   43 | l_float32  angle, deg2rad, ang;
#      |            ^~~~~
#   41|   l_int32    i, w, h, d, rotflag;
#   42|   PIX       *pixs, *pixt, *pixd;
#   43|-> l_float32  angle, deg2rad, ang;
#   44|   char      *filein, *fileout;
#   45|   

Error: COMPILER_WARNING: [#def23]
leptonica-1.87.0/prog/rotatetest1.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/rotatetest1.c:44:21: warning[-Wunused-but-set-variable=]: variable ‘fileout’ set but not used
#   44 | char      *filein, *fileout;
#      |                     ^~~~~~~
#   42|   PIX       *pixs, *pixt, *pixd;
#   43|   l_float32  angle, deg2rad, ang;
#   44|-> char      *filein, *fileout;
#   45|   
#   46|       if (argc != 4)

Error: COMPILER_WARNING: [#def24]
leptonica-1.87.0/prog/seedfilltest.c:48:21: warning[-Wunused-but-set-variable=]: variable ‘fileout’ set but not used
#   48 | char      *filein, *fileout;
#      |                     ^~~~~~~
#   46|            char **argv)
#   47|   {
#   48|-> char      *filein, *fileout;
#   49|   l_int32    i;
#   50|   l_uint32   val;

Error: COMPILER_WARNING: [#def25]
leptonica-1.87.0/prog/seedfilltest.c:51:12: warning[-Wunused-but-set-variable=]: variable ‘size’ set but not used
#   51 | l_float32  size;
#      |            ^~~~
#   49|   l_int32    i;
#   50|   l_uint32   val;
#   51|-> l_float32  size;
#   52|   PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#   53|   

Error: COMPILER_WARNING (CWE-563): [#def26]
leptonica-1.87.0/prog/seedfilltest.c:52:41: warning[-Wunused-variable]: unused variable ‘pixt1’
#   52 | PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#      |                                         ^~~~~
#   50|   l_uint32   val;
#   51|   l_float32  size;
#   52|-> PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#   53|   
#   54|       if (argc != 3)

Error: COMPILER_WARNING (CWE-563): [#def27]
leptonica-1.87.0/prog/seedfilltest.c:52:49: warning[-Wunused-variable]: unused variable ‘pixt2’
#   52 | PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#      |                                                 ^~~~~
#   50|   l_uint32   val;
#   51|   l_float32  size;
#   52|-> PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#   53|   
#   54|       if (argc != 3)

Error: COMPILER_WARNING (CWE-563): [#def28]
leptonica-1.87.0/prog/seedfilltest.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/seedfilltest.c:52:57: warning[-Wunused-variable]: unused variable ‘pixt3’
#   52 | PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#      |                                                         ^~~~~
#   50|   l_uint32   val;
#   51|   l_float32  size;
#   52|-> PIX       *pixs, *pixd, *pixm, *pixmi, *pixt1, *pixt2, *pixt3;
#   53|   
#   54|       if (argc != 3)

Error: COMPILER_WARNING: [#def29]
leptonica-1.87.0/prog/sheartest.c:46:21: warning[-Wunused-but-set-variable=]: variable ‘fileout’ set but not used
#   46 | char      *filein, *fileout;
#      |                     ^~~~~~~
#   44|            char **argv)
#   45|   {
#   46|-> char      *filein, *fileout;
#   47|   l_int32    i, w, h, liney, linex, same;
#   48|   l_float32  angle, deg2rad;

Error: COMPILER_WARNING (CWE-563): [#def30]
leptonica-1.87.0/prog/sheartest.c:47:12: warning[-Wunused-variable]: unused variable ‘i’
#   47 | l_int32    i, w, h, liney, linex, same;
#      |            ^
#   45|   {
#   46|   char      *filein, *fileout;
#   47|-> l_int32    i, w, h, liney, linex, same;
#   48|   l_float32  angle, deg2rad;
#   49|   PIX       *pixt1, *pixt2, *pixs, *pixd;

Error: COMPILER_WARNING (CWE-563): [#def31]
leptonica-1.87.0/prog/sheartest.c:47:21: warning[-Wunused-variable]: unused variable ‘liney’
#   47 | l_int32    i, w, h, liney, linex, same;
#      |                     ^~~~~
#   45|   {
#   46|   char      *filein, *fileout;
#   47|-> l_int32    i, w, h, liney, linex, same;
#   48|   l_float32  angle, deg2rad;
#   49|   PIX       *pixt1, *pixt2, *pixs, *pixd;

Error: COMPILER_WARNING (CWE-563): [#def32]
leptonica-1.87.0/prog/sheartest.c:47:28: warning[-Wunused-variable]: unused variable ‘linex’
#   47 | l_int32    i, w, h, liney, linex, same;
#      |                            ^~~~~
#   45|   {
#   46|   char      *filein, *fileout;
#   47|-> l_int32    i, w, h, liney, linex, same;
#   48|   l_float32  angle, deg2rad;
#   49|   PIX       *pixt1, *pixt2, *pixs, *pixd;

Error: COMPILER_WARNING: [#def33]
leptonica-1.87.0/prog/sheartest.c:48:12: warning[-Wunused-but-set-variable=]: variable ‘angle’ set but not used
#   48 | l_float32  angle, deg2rad;
#      |            ^~~~~
#   46|   char      *filein, *fileout;
#   47|   l_int32    i, w, h, liney, linex, same;
#   48|-> l_float32  angle, deg2rad;
#   49|   PIX       *pixt1, *pixt2, *pixs, *pixd;
#   50|   

Error: COMPILER_WARNING: [#def34]
leptonica-1.87.0/prog/sheartest.c:48:19: warning[-Wunused-but-set-variable=]: variable ‘deg2rad’ set but not used
#   48 | l_float32  angle, deg2rad;
#      |                   ^~~~~~~
#   46|   char      *filein, *fileout;
#   47|   l_int32    i, w, h, liney, linex, same;
#   48|-> l_float32  angle, deg2rad;
#   49|   PIX       *pixt1, *pixt2, *pixs, *pixd;
#   50|   

Error: COMPILER_WARNING (CWE-563): [#def35]
leptonica-1.87.0/prog/sheartest.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/sheartest.c:49:35: warning[-Wunused-variable]: unused variable ‘pixd’
#   49 | PIX       *pixt1, *pixt2, *pixs, *pixd;
#      |                                   ^~~~
#   47|   l_int32    i, w, h, liney, linex, same;
#   48|   l_float32  angle, deg2rad;
#   49|-> PIX       *pixt1, *pixt2, *pixs, *pixd;
#   50|   
#   51|       if (argc != 4)

Error: COMPILER_WARNING (CWE-563): [#def36]
leptonica-1.87.0/prog/sorttest.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/sorttest.c:45:10: warning[-Wunused-variable]: unused variable ‘i’
#   45 | l_int32  i, n, ns;
#      |          ^
#   43|   {
#   44|   char    *filein;
#   45|-> l_int32  i, n, ns;
#   46|   BOXA    *boxa;
#   47|   PIX     *pixs, *pixt;

Error: COMPILER_WARNING: [#def37]
leptonica-1.87.0/prog/warpertest.c: scope_hint: In function ‘main’
leptonica-1.87.0/prog/warpertest.c:56:27: warning[-Wunused-but-set-variable=]: variable ‘index’ set but not used
#   56 | l_int32    w, h, i, j, k, index, op, dir, stretch;
#      |                           ^~~~~
#   54|   {
#   55|   char       buf[256];
#   56|-> l_int32    w, h, i, j, k, index, op, dir, stretch;
#   57|   l_float32  del, angle, angledeg;
#   58|   BOX       *box;

Error: COMPILER_WARNING (CWE-686): [#def38]
leptonica-1.87.0/redhat-linux-build/CMakeFiles/CMakeScratch/TryCompile-dErlau/CheckFunctionExists.c:7:3: warning[-Wbuiltin-declaration-mismatch]: conflicting types for built-in function ‘sin’; expected ‘double(double)’

Error: CPPCHECK_WARNING (CWE-476): [#def39]
leptonica-1.87.0/src/adaptmap.c:2111: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lut
# 2109|               for (j = 0; j < 256; j++) {
# 2110|                   fval = (l_float32)(i * target) / (j + 0.5);
# 2111|->                 lut[(i << 8) + j] = L_MIN(255, (l_int32)(fval + 0.5));
# 2112|               }
# 2113|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def40]
leptonica-1.87.0/src/adaptmap.c:2111:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lut’
leptonica-1.87.0/src/adaptmap.c:2088:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/adaptmap.c:2090:8: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2090:8: branch_false: following ‘false’ branch (when ‘pixg’ is non-NULL)...
leptonica-1.87.0/src/adaptmap.c:2092:10: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2092:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2094:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2095:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2106:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2106:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/adaptmap.c:2107:26: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2107:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/adaptmap.c:2108:21: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/adaptmap.c:2108:21: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2109:25: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/adaptmap.c:2110:35: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2111:17: danger: ‘lut + (sizetype)((i << 8) + j)’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
# 2109|               for (j = 0; j < 256; j++) {
# 2110|                   fval = (l_float32)(i * target) / (j + 0.5);
# 2111|->                 lut[(i << 8) + j] = L_MIN(255, (l_int32)(fval + 0.5));
# 2112|               }
# 2113|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
leptonica-1.87.0/src/adaptmap.c:2850:17: warning[-Wanalyzer-malloc-leak]: leak of ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: allocated here
leptonica-1.87.0/src/adaptmap.c:2850:17: throw: if ‘pixCopy’ throws an exception...
leptonica-1.87.0/src/adaptmap.c:2850:17: danger: ‘iaa’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
# 2848|   
# 2849|       iaa = (l_int32 **)LEPT_CALLOC(256, sizeof(l_int32 *));
# 2850|->     if ((pixd = pixCopy(pixd, pixs)) == NULL) {
# 2851|           LEPT_FREE(iaa);
# 2852|           return (PIX *)ERROR_PTR("pixd not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
leptonica-1.87.0/src/adaptmap.c:2854:5: warning[-Wanalyzer-malloc-leak]: leak of ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: allocated here
leptonica-1.87.0/src/adaptmap.c:2850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2854:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2854:5: throw: if ‘pixGetDimensions’ throws an exception...
leptonica-1.87.0/src/adaptmap.c:2854:5: danger: ‘iaa’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
# 2852|           return (PIX *)ERROR_PTR("pixd not made", __func__, NULL);
# 2853|       }
# 2854|->     pixGetDimensions(pixd, &w, &h, NULL);
# 2855|   
# 2856|       data = pixGetData(pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
leptonica-1.87.0/src/adaptmap.c:2856:12: warning[-Wanalyzer-malloc-leak]: leak of ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: allocated here
leptonica-1.87.0/src/adaptmap.c:2850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2854:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2856:12: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/adaptmap.c:2856:12: danger: ‘iaa’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
# 2854|       pixGetDimensions(pixd, &w, &h, NULL);
# 2855|   
# 2856|->     data = pixGetData(pixd);
# 2857|       wpl = pixGetWpl(pixd);
# 2858|       datamin = pixGetData(pixmin);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
leptonica-1.87.0/src/adaptmap.c:2857:11: warning[-Wanalyzer-malloc-leak]: leak of ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: allocated here
leptonica-1.87.0/src/adaptmap.c:2850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2854:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2857:11: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/adaptmap.c:2857:11: danger: ‘iaa’ leaks here; was allocated at [(11)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/10)
# 2855|   
# 2856|       data = pixGetData(pixd);
# 2857|->     wpl = pixGetWpl(pixd);
# 2858|       datamin = pixGetData(pixmin);
# 2859|       datamax = pixGetData(pixmax);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
leptonica-1.87.0/src/adaptmap.c:2858:15: warning[-Wanalyzer-malloc-leak]: leak of ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: allocated here
leptonica-1.87.0/src/adaptmap.c:2850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2854:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2858:15: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/adaptmap.c:2858:15: danger: ‘iaa’ leaks here; was allocated at [(11)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/10)
# 2856|       data = pixGetData(pixd);
# 2857|       wpl = pixGetWpl(pixd);
# 2858|->     datamin = pixGetData(pixmin);
# 2859|       datamax = pixGetData(pixmax);
# 2860|       wplt = pixGetWpl(pixmin);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
leptonica-1.87.0/src/adaptmap.c:2859:15: warning[-Wanalyzer-malloc-leak]: leak of ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: allocated here
leptonica-1.87.0/src/adaptmap.c:2850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2854:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2859:15: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/adaptmap.c:2859:15: danger: ‘iaa’ leaks here; was allocated at [(11)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/10)
# 2857|       wpl = pixGetWpl(pixd);
# 2858|       datamin = pixGetData(pixmin);
# 2859|->     datamax = pixGetData(pixmax);
# 2860|       wplt = pixGetWpl(pixmin);
# 2861|       pixGetDimensions(pixmin, &wt, &ht, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
leptonica-1.87.0/src/adaptmap.c:2860:12: warning[-Wanalyzer-malloc-leak]: leak of ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: allocated here
leptonica-1.87.0/src/adaptmap.c:2850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2854:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2860:12: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/adaptmap.c:2860:12: danger: ‘iaa’ leaks here; was allocated at [(11)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/10)
# 2858|       datamin = pixGetData(pixmin);
# 2859|       datamax = pixGetData(pixmax);
# 2860|->     wplt = pixGetWpl(pixmin);
# 2861|       pixGetDimensions(pixmin, &wt, &ht, NULL);
# 2862|       for (i = 0; i < ht; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
leptonica-1.87.0/src/adaptmap.c:2861:5: warning[-Wanalyzer-malloc-leak]: leak of ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: allocated here
leptonica-1.87.0/src/adaptmap.c:2850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2854:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2861:5: throw: if ‘pixGetDimensions’ throws an exception...
leptonica-1.87.0/src/adaptmap.c:2861:5: danger: ‘iaa’ leaks here; was allocated at [(11)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/10)
# 2859|       datamax = pixGetData(pixmax);
# 2860|       wplt = pixGetWpl(pixmin);
# 2861|->     pixGetDimensions(pixmin, &wt, &ht, NULL);
# 2862|       for (i = 0; i < ht; i++) {
# 2863|           line = data + sy * i * wpl;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
leptonica-1.87.0/src/adaptmap.c:2872:17: warning[-Wanalyzer-malloc-leak]: leak of ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: allocated here
leptonica-1.87.0/src/adaptmap.c:2850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2854:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2862:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/adaptmap.c:2863:23: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2867:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/adaptmap.c:2868:13: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2871:16: branch_true: following ‘true’ branch (when ‘minval == maxval’)...
leptonica-1.87.0/src/adaptmap.c:2872:17: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2872:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/adaptmap.c:2872:17: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2872:17: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/adaptmap.c:2872:17: danger: ‘iaa’ leaks here; was allocated at [(11)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/10)
# 2870|               maxval = GET_DATA_BYTE(linemax, j);
# 2871|               if (maxval == minval) {
# 2872|->                 L_ERROR("shouldn't happen! i,j = %d,%d, minval = %d\n",
# 2873|                           __func__, i, j, minval);
# 2874|                   continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
leptonica-1.87.0/src/adaptmap.c:2877:17: warning[-Wanalyzer-malloc-leak]: leak of ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2825:1: enter_function: entry to ‘pixLinearTRCTiled’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: allocated here
leptonica-1.87.0/src/adaptmap.c:2850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2854:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2862:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/adaptmap.c:2863:23: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2871:16: branch_true: following ‘true’ branch (when ‘minval == maxval’)...
leptonica-1.87.0/src/adaptmap.c:2872:17: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2876:23: call_function: calling ‘iaaGetLinearTRC’ from ‘pixLinearTRCTiled’
leptonica-1.87.0/src/adaptmap.c:2876:23: return_function: returning to ‘pixLinearTRCTiled’ from ‘iaaGetLinearTRC’
leptonica-1.87.0/src/adaptmap.c:2877:17: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/adaptmap.c:2877:17: danger: ‘iaa’ leaks here; was allocated at [(12)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/11)
# 2875|               }
# 2876|               if ((ia = iaaGetLinearTRC(iaa, maxval - minval)) == NULL) {
# 2877|->                 L_ERROR("failure to make ia for j = %d!\n", __func__, j);
# 2878|                   continue;
# 2879|               }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def51]
leptonica-1.87.0/src/adaptmap.c:2893:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘iaa’
leptonica-1.87.0/src/adaptmap.c:2838:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2840:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2842:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2842:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2844:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2844:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2846:9: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2849:23: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2849:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/adaptmap.c:2850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2854:5: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2892:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/adaptmap.c:2893:9: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2893:9: danger: ‘iaa + (long unsigned int)i * 8’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/10)
# 2891|   
# 2892|       for (i = 0; i < 256; i++)
# 2893|->         LEPT_FREE(iaa[i]);
# 2894|       LEPT_FREE(iaa);
# 2895|       return pixd;

Error: CPPCHECK_WARNING (CWE-476): [#def52]
leptonica-1.87.0/src/adaptmap.c:2926: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ia
# 2924|       if (diff == 0) {  /* shouldn't happen */
# 2925|           for (i = 0; i < 256; i++)
# 2926|->             ia[i] = 128;
# 2927|       }
# 2928|       else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def53]
leptonica-1.87.0/src/adaptmap.c:2926:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ia’
leptonica-1.87.0/src/adaptmap.c:2916:8: branch_false: following ‘false’ branch (when ‘iaa’ is non-NULL)...
leptonica-1.87.0/src/adaptmap.c:2919:12: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2919:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2922:21: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2922:21: acquire_memory: this call could return NULL
leptonica-1.87.0/src/adaptmap.c:2924:8: branch_true: following ‘true’ branch (when ‘diff == 0’)...
leptonica-1.87.0/src/adaptmap.c:2924:8: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2925:21: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/adaptmap.c:2926:15: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2926:13: danger: ‘ia + (long unsigned int)i * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
# 2924|       if (diff == 0) {  /* shouldn't happen */
# 2925|           for (i = 0; i < 256; i++)
# 2926|->             ia[i] = 128;
# 2927|       }
# 2928|       else {

Error: CPPCHECK_WARNING (CWE-476): [#def54]
leptonica-1.87.0/src/adaptmap.c:2931: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ia
# 2929|           factor = 255. / (l_float32)diff;
# 2930|           for (i = 0; i < diff + 1; i++)
# 2931|->             ia[i] = (l_int32)(factor * i + 0.5);
# 2932|           for (i = diff + 1; i < 256; i++)
# 2933|               ia[i] = 255;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def55]
leptonica-1.87.0/src/adaptmap.c:2931:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ia’
leptonica-1.87.0/src/adaptmap.c:2916:8: branch_false: following ‘false’ branch (when ‘iaa’ is non-NULL)...
leptonica-1.87.0/src/adaptmap.c:2919:12: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2919:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/adaptmap.c:2922:21: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2922:21: acquire_memory: this call could return NULL
leptonica-1.87.0/src/adaptmap.c:2924:8: branch_false: following ‘false’ branch (when ‘diff != 0’)...
leptonica-1.87.0/src/adaptmap.c:2929:25: branch_false: ...to here
leptonica-1.87.0/src/adaptmap.c:2930:21: branch_true: following ‘true’ branch (when ‘i <= diff’)...
leptonica-1.87.0/src/adaptmap.c:2931:31: branch_true: ...to here
leptonica-1.87.0/src/adaptmap.c:2931:13: danger: ‘ia + (long unsigned int)i * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
# 2929|           factor = 255. / (l_float32)diff;
# 2930|           for (i = 0; i < diff + 1; i++)
# 2931|->             ia[i] = (l_int32)(factor * i + 0.5);
# 2932|           for (i = diff + 1; i < 256; i++)
# 2933|               ia[i] = 255;

Error: CPPCHECK_WARNING (CWE-476): [#def56]
leptonica-1.87.0/src/adaptmap.c:2933: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ia
# 2931|               ia[i] = (l_int32)(factor * i + 0.5);
# 2932|           for (i = diff + 1; i < 256; i++)
# 2933|->             ia[i] = 255;
# 2934|       }
# 2935|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
leptonica-1.87.0/src/affine.c:934:5: warning[-Wanalyzer-malloc-leak]: leak of ‘vc’
leptonica-1.87.0/src/affine.c:642:1: enter_function: entry to ‘pixAffinePtaGray’
leptonica-1.87.0/src/affine.c:650:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/affine.c:652:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:652:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:654:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:654:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:656:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:656:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:658:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:658:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:660:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:660:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:664:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:664:5: call_function: calling ‘getAffineXformCoeffs’ from ‘pixAffinePtaGray’
#  932|       *pvc = b;
#  933|   
#  934|->     ptaGetPt(ptas, 0, &x1, &y1);
#  935|       ptaGetPt(ptas, 1, &x2, &y2);
#  936|       ptaGetPt(ptas, 2, &x3, &y3);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
leptonica-1.87.0/src/affine.c:935:5: warning[-Wanalyzer-malloc-leak]: leak of ‘vc’
leptonica-1.87.0/src/affine.c:642:1: enter_function: entry to ‘pixAffinePtaGray’
leptonica-1.87.0/src/affine.c:650:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/affine.c:652:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:652:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:654:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:654:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:656:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:656:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:658:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:658:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:660:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:660:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:664:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:664:5: call_function: calling ‘getAffineXformCoeffs’ from ‘pixAffinePtaGray’
#  933|   
#  934|       ptaGetPt(ptas, 0, &x1, &y1);
#  935|->     ptaGetPt(ptas, 1, &x2, &y2);
#  936|       ptaGetPt(ptas, 2, &x3, &y3);
#  937|       ptaGetPt(ptad, 0, &b[0], &b[1]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
leptonica-1.87.0/src/affine.c:936:5: warning[-Wanalyzer-malloc-leak]: leak of ‘vc’
leptonica-1.87.0/src/affine.c:642:1: enter_function: entry to ‘pixAffinePtaGray’
leptonica-1.87.0/src/affine.c:650:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/affine.c:652:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:652:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:654:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:654:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:656:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:656:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:658:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:658:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:660:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:660:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:664:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:664:5: call_function: calling ‘getAffineXformCoeffs’ from ‘pixAffinePtaGray’
#  934|       ptaGetPt(ptas, 0, &x1, &y1);
#  935|       ptaGetPt(ptas, 1, &x2, &y2);
#  936|->     ptaGetPt(ptas, 2, &x3, &y3);
#  937|       ptaGetPt(ptad, 0, &b[0], &b[1]);
#  938|       ptaGetPt(ptad, 1, &b[2], &b[3]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
leptonica-1.87.0/src/affine.c:937:5: warning[-Wanalyzer-malloc-leak]: leak of ‘vc’
leptonica-1.87.0/src/affine.c:642:1: enter_function: entry to ‘pixAffinePtaGray’
leptonica-1.87.0/src/affine.c:650:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/affine.c:652:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:652:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:654:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:654:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:656:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:656:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:658:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:658:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:660:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:660:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:664:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:664:5: call_function: calling ‘getAffineXformCoeffs’ from ‘pixAffinePtaGray’
#  935|       ptaGetPt(ptas, 1, &x2, &y2);
#  936|       ptaGetPt(ptas, 2, &x3, &y3);
#  937|->     ptaGetPt(ptad, 0, &b[0], &b[1]);
#  938|       ptaGetPt(ptad, 1, &b[2], &b[3]);
#  939|       ptaGetPt(ptad, 2, &b[4], &b[5]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def61]
leptonica-1.87.0/src/affine.c:943:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[0]’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:943:5: danger: ‘a[0]’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
#  941|       for (i = 0; i < 6; i++)
#  942|           a[i] = (l_float32 *)LEPT_CALLOC(6, sizeof(l_float32));
#  943|->     a[0][0] = x1;
#  944|       a[0][1] = y1;
#  945|       a[0][2] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def62]
leptonica-1.87.0/src/affine.c:946:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[1]’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:946:5: danger: ‘a[1]’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/10)
#  944|       a[0][1] = y1;
#  945|       a[0][2] = 1.;
#  946|->     a[1][3] = x1;
#  947|       a[1][4] = y1;
#  948|       a[1][5] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def63]
leptonica-1.87.0/src/affine.c:949:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[2]’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:949:5: danger: ‘a[2]’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/12)
#  947|       a[1][4] = y1;
#  948|       a[1][5] = 1.;
#  949|->     a[2][0] = x2;
#  950|       a[2][1] = y2;
#  951|       a[2][2] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def64]
leptonica-1.87.0/src/affine.c:952:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[3]’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:952:5: danger: ‘a[3]’ could be NULL: unchecked value from [(15)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/14)
#  950|       a[2][1] = y2;
#  951|       a[2][2] = 1.;
#  952|->     a[3][3] = x2;
#  953|       a[3][4] = y2;
#  954|       a[3][5] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def65]
leptonica-1.87.0/src/affine.c:955:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[4]’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:955:5: danger: ‘a[4]’ could be NULL: unchecked value from [(17)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/16)
#  953|       a[3][4] = y2;
#  954|       a[3][5] = 1.;
#  955|->     a[4][0] = x3;
#  956|       a[4][1] = y3;
#  957|       a[4][2] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def66]
leptonica-1.87.0/src/affine.c:958:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[5]’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:958:5: danger: ‘a[5]’ could be NULL: unchecked value from [(19)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/18)
#  956|       a[4][1] = y3;
#  957|       a[4][2] = 1.;
#  958|->     a[5][3] = x3;
#  959|       a[5][4] = y3;
#  960|       a[5][5] = 1.;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def67]
leptonica-1.87.0/src/affine.c:1020:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[0]’
leptonica-1.87.0/src/affine.c:1011:8: branch_false: following ‘false’ branch (when ‘pvci’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1013:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1014:8: branch_false: following ‘false’ branch (when ‘vc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1014:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1019:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_false: following ‘false’ branch (when ‘i == 3’)...
leptonica-1.87.0/src/affine.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1020:5: danger: ‘a[0]’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/6)
# 1018|       for (i = 0; i < 3; i++)
# 1019|           a[i] = (l_float32 *)LEPT_CALLOC(3, sizeof(l_float32));
# 1020|->     a[0][0] = vc[0];
# 1021|       a[0][1] = vc[1];
# 1022|       a[0][2] = vc[2];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def68]
leptonica-1.87.0/src/affine.c:1023:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[1]’
leptonica-1.87.0/src/affine.c:1011:8: branch_false: following ‘false’ branch (when ‘pvci’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1013:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1014:8: branch_false: following ‘false’ branch (when ‘vc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1014:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1019:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_false: following ‘false’ branch (when ‘i == 3’)...
leptonica-1.87.0/src/affine.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1023:5: danger: ‘a[1]’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/8)
# 1021|       a[0][1] = vc[1];
# 1022|       a[0][2] = vc[2];
# 1023|->     a[1][0] = vc[3];
# 1024|       a[1][1] = vc[4];
# 1025|       a[1][2] = vc[5];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def69]
leptonica-1.87.0/src/affine.c:1026:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘a[2]’
leptonica-1.87.0/src/affine.c:1011:8: branch_false: following ‘false’ branch (when ‘pvci’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1013:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1014:8: branch_false: following ‘false’ branch (when ‘vc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1014:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1019:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/affine.c:1018:17: branch_false: following ‘false’ branch (when ‘i == 3’)...
leptonica-1.87.0/src/affine.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1026:5: danger: ‘a[2]’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/10)
# 1024|       a[1][1] = vc[4];
# 1025|       a[1][2] = vc[5];
# 1026|->     a[2][2] = 1.0;
# 1027|       gaussjordan(a, b, 3);  /* this inverts matrix a */
# 1028|       vci = (l_float32 *)LEPT_CALLOC(6, sizeof(l_float32));

Error: CPPCHECK_WARNING (CWE-476): [#def70]
leptonica-1.87.0/src/affine.c:1030: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vci
# 1028|       vci = (l_float32 *)LEPT_CALLOC(6, sizeof(l_float32));
# 1029|       *pvci = vci;
# 1030|->     vci[0] = a[0][0];
# 1031|       vci[1] = a[0][1];
# 1032|       vci[2] = a[0][2];

Error: CPPCHECK_WARNING (CWE-476): [#def71]
leptonica-1.87.0/src/affine.c:1031: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vci
# 1029|       *pvci = vci;
# 1030|       vci[0] = a[0][0];
# 1031|->     vci[1] = a[0][1];
# 1032|       vci[2] = a[0][2];
# 1033|       vci[3] = a[1][0];

Error: CPPCHECK_WARNING (CWE-476): [#def72]
leptonica-1.87.0/src/affine.c:1032: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vci
# 1030|       vci[0] = a[0][0];
# 1031|       vci[1] = a[0][1];
# 1032|->     vci[2] = a[0][2];
# 1033|       vci[3] = a[1][0];
# 1034|       vci[4] = a[1][1];

Error: CPPCHECK_WARNING (CWE-476): [#def73]
leptonica-1.87.0/src/affine.c:1033: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vci
# 1031|       vci[1] = a[0][1];
# 1032|       vci[2] = a[0][2];
# 1033|->     vci[3] = a[1][0];
# 1034|       vci[4] = a[1][1];
# 1035|       vci[5] = a[1][2];

Error: CPPCHECK_WARNING (CWE-476): [#def74]
leptonica-1.87.0/src/affine.c:1034: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vci
# 1032|       vci[2] = a[0][2];
# 1033|       vci[3] = a[1][0];
# 1034|->     vci[4] = a[1][1];
# 1035|       vci[5] = a[1][2];
# 1036|       for (i = 0; i < 3; i++)

Error: CPPCHECK_WARNING (CWE-476): [#def75]
leptonica-1.87.0/src/affine.c:1035: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vci
# 1033|       vci[3] = a[1][0];
# 1034|       vci[4] = a[1][1];
# 1035|->     vci[5] = a[1][2];
# 1036|       for (i = 0; i < 3; i++)
# 1037|           LEPT_FREE(a[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
leptonica-1.87.0/src/affine.c:1325:16: warning[-Wanalyzer-malloc-leak]: leak of ‘a[0]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1323|           return ERROR_INT("a not defined", __func__, 1);
# 1324|       if (!b)
# 1325|->         return ERROR_INT("b not defined", __func__, 1);
# 1326|   
# 1327|       success = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
leptonica-1.87.0/src/affine.c:1325:16: warning[-Wanalyzer-malloc-leak]: leak of ‘a[1]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1323|           return ERROR_INT("a not defined", __func__, 1);
# 1324|       if (!b)
# 1325|->         return ERROR_INT("b not defined", __func__, 1);
# 1326|   
# 1327|       success = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
leptonica-1.87.0/src/affine.c:1325:16: warning[-Wanalyzer-malloc-leak]: leak of ‘a[2]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1323|           return ERROR_INT("a not defined", __func__, 1);
# 1324|       if (!b)
# 1325|->         return ERROR_INT("b not defined", __func__, 1);
# 1326|   
# 1327|       success = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
leptonica-1.87.0/src/affine.c:1325:16: warning[-Wanalyzer-malloc-leak]: leak of ‘a[3]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1323|           return ERROR_INT("a not defined", __func__, 1);
# 1324|       if (!b)
# 1325|->         return ERROR_INT("b not defined", __func__, 1);
# 1326|   
# 1327|       success = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
leptonica-1.87.0/src/affine.c:1325:16: warning[-Wanalyzer-malloc-leak]: leak of ‘a[4]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1323|           return ERROR_INT("a not defined", __func__, 1);
# 1324|       if (!b)
# 1325|->         return ERROR_INT("b not defined", __func__, 1);
# 1326|   
# 1327|       success = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
leptonica-1.87.0/src/affine.c:1325:16: warning[-Wanalyzer-malloc-leak]: leak of ‘a[5]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1323|           return ERROR_INT("a not defined", __func__, 1);
# 1324|       if (!b)
# 1325|->         return ERROR_INT("b not defined", __func__, 1);
# 1326|   
# 1327|       success = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
leptonica-1.87.0/src/affine.c:1332:9: warning[-Wanalyzer-malloc-leak]: leak of ‘a[0]’
leptonica-1.87.0/src/affine.c:1003:1: enter_function: entry to ‘affineInvertXform’
leptonica-1.87.0/src/affine.c:1011:8: branch_false: following ‘false’ branch (when ‘pvci’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1013:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1014:8: branch_false: following ‘false’ branch (when ‘vc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1014:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1019:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_false: following ‘false’ branch (when ‘i == 3’)...
leptonica-1.87.0/src/affine.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1027:5: call_function: calling ‘gaussjordan’ from ‘affineInvertXform’
# 1330|       ipiv = (l_int32 *)LEPT_CALLOC(n, sizeof(l_int32));
# 1331|       if (!indexc || !indexr || !ipiv) {
# 1332|->         L_ERROR("array not made\n", __func__);
# 1333|           success = FALSE;
# 1334|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
leptonica-1.87.0/src/affine.c:1332:9: warning[-Wanalyzer-malloc-leak]: leak of ‘a[1]’
leptonica-1.87.0/src/affine.c:1003:1: enter_function: entry to ‘affineInvertXform’
leptonica-1.87.0/src/affine.c:1011:8: branch_false: following ‘false’ branch (when ‘pvci’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1013:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1014:8: branch_false: following ‘false’ branch (when ‘vc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1014:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1019:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_false: following ‘false’ branch (when ‘i == 3’)...
leptonica-1.87.0/src/affine.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1027:5: call_function: calling ‘gaussjordan’ from ‘affineInvertXform’
# 1330|       ipiv = (l_int32 *)LEPT_CALLOC(n, sizeof(l_int32));
# 1331|       if (!indexc || !indexr || !ipiv) {
# 1332|->         L_ERROR("array not made\n", __func__);
# 1333|           success = FALSE;
# 1334|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
leptonica-1.87.0/src/affine.c:1332:9: warning[-Wanalyzer-malloc-leak]: leak of ‘a[2]’
leptonica-1.87.0/src/affine.c:1003:1: enter_function: entry to ‘affineInvertXform’
leptonica-1.87.0/src/affine.c:1011:8: branch_false: following ‘false’ branch (when ‘pvci’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1013:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1014:8: branch_false: following ‘false’ branch (when ‘vc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1014:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1019:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1018:17: branch_false: following ‘false’ branch (when ‘i == 3’)...
leptonica-1.87.0/src/affine.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1027:5: call_function: calling ‘gaussjordan’ from ‘affineInvertXform’
# 1330|       ipiv = (l_int32 *)LEPT_CALLOC(n, sizeof(l_int32));
# 1331|       if (!indexc || !indexr || !ipiv) {
# 1332|->         L_ERROR("array not made\n", __func__);
# 1333|           success = FALSE;
# 1334|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
leptonica-1.87.0/src/affine.c:1332:9: warning[-Wanalyzer-malloc-leak]: leak of ‘a[3]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1330|       ipiv = (l_int32 *)LEPT_CALLOC(n, sizeof(l_int32));
# 1331|       if (!indexc || !indexr || !ipiv) {
# 1332|->         L_ERROR("array not made\n", __func__);
# 1333|           success = FALSE;
# 1334|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
leptonica-1.87.0/src/affine.c:1332:9: warning[-Wanalyzer-malloc-leak]: leak of ‘a[4]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1330|       ipiv = (l_int32 *)LEPT_CALLOC(n, sizeof(l_int32));
# 1331|       if (!indexc || !indexr || !ipiv) {
# 1332|->         L_ERROR("array not made\n", __func__);
# 1333|           success = FALSE;
# 1334|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
leptonica-1.87.0/src/affine.c:1332:9: warning[-Wanalyzer-malloc-leak]: leak of ‘a[5]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1330|       ipiv = (l_int32 *)LEPT_CALLOC(n, sizeof(l_int32));
# 1331|       if (!indexc || !indexr || !ipiv) {
# 1332|->         L_ERROR("array not made\n", __func__);
# 1333|           success = FALSE;
# 1334|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
leptonica-1.87.0/src/affine.c:1332:9: warning[-Wanalyzer-malloc-leak]: leak of ‘indexc’
leptonica-1.87.0/src/affine.c:1322:8: branch_false: following ‘false’ branch (when ‘a’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1324:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1324:8: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1328:25: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1328:25: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1331:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1332:9: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1332:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1332:9: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1332:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/affine.c:1332:9: danger: ‘indexc’ leaks here; was allocated at [(5)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/4)
# 1330|       ipiv = (l_int32 *)LEPT_CALLOC(n, sizeof(l_int32));
# 1331|       if (!indexc || !indexr || !ipiv) {
# 1332|->         L_ERROR("array not made\n", __func__);
# 1333|           success = FALSE;
# 1334|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
leptonica-1.87.0/src/affine.c:1332:9: warning[-Wanalyzer-malloc-leak]: leak of ‘indexr’
leptonica-1.87.0/src/affine.c:1322:8: branch_false: following ‘false’ branch (when ‘a’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1324:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1324:8: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1328:25: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1329:25: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1331:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1332:9: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1332:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1332:9: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1332:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/affine.c:1332:9: danger: ‘indexr’ leaks here; was allocated at [(5)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/4)
# 1330|       ipiv = (l_int32 *)LEPT_CALLOC(n, sizeof(l_int32));
# 1331|       if (!indexc || !indexr || !ipiv) {
# 1332|->         L_ERROR("array not made\n", __func__);
# 1333|           success = FALSE;
# 1334|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
leptonica-1.87.0/src/affine.c:1332:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ipiv’
leptonica-1.87.0/src/affine.c:1322:8: branch_false: following ‘false’ branch (when ‘a’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1324:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1324:8: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1328:25: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1330:23: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1331:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1332:9: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1332:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1332:9: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1332:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/affine.c:1332:9: danger: ‘ipiv’ leaks here; was allocated at [(5)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/4)
# 1330|       ipiv = (l_int32 *)LEPT_CALLOC(n, sizeof(l_int32));
# 1331|       if (!indexc || !indexr || !ipiv) {
# 1332|->         L_ERROR("array not made\n", __func__);
# 1333|           success = FALSE;
# 1334|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
leptonica-1.87.0/src/affine.c:1350:25: warning[-Wanalyzer-malloc-leak]: leak of ‘a[0]’
leptonica-1.87.0/src/affine.c:1003:1: enter_function: entry to ‘affineInvertXform’
leptonica-1.87.0/src/affine.c:1011:8: branch_false: following ‘false’ branch (when ‘pvci’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1013:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1014:8: branch_false: following ‘false’ branch (when ‘vc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1014:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1019:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_false: following ‘false’ branch (when ‘i == 3’)...
leptonica-1.87.0/src/affine.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1027:5: call_function: calling ‘gaussjordan’ from ‘affineInvertXform’
# 1348|                           }
# 1349|                       } else if (ipiv[k] > 1) {
# 1350|->                         L_ERROR("singular matrix\n", __func__);
# 1351|                           success = FALSE;
# 1352|                           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
leptonica-1.87.0/src/affine.c:1350:25: warning[-Wanalyzer-malloc-leak]: leak of ‘a[1]’
leptonica-1.87.0/src/affine.c:1003:1: enter_function: entry to ‘affineInvertXform’
leptonica-1.87.0/src/affine.c:1011:8: branch_false: following ‘false’ branch (when ‘pvci’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1013:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1014:8: branch_false: following ‘false’ branch (when ‘vc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1014:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1019:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_false: following ‘false’ branch (when ‘i == 3’)...
leptonica-1.87.0/src/affine.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1027:5: call_function: calling ‘gaussjordan’ from ‘affineInvertXform’
# 1348|                           }
# 1349|                       } else if (ipiv[k] > 1) {
# 1350|->                         L_ERROR("singular matrix\n", __func__);
# 1351|                           success = FALSE;
# 1352|                           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
leptonica-1.87.0/src/affine.c:1350:25: warning[-Wanalyzer-malloc-leak]: leak of ‘a[2]’
leptonica-1.87.0/src/affine.c:1003:1: enter_function: entry to ‘affineInvertXform’
leptonica-1.87.0/src/affine.c:1011:8: branch_false: following ‘false’ branch (when ‘pvci’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1013:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1014:8: branch_false: following ‘false’ branch (when ‘vc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1014:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1018:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
leptonica-1.87.0/src/affine.c:1019:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1019:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1018:17: branch_false: following ‘false’ branch (when ‘i == 3’)...
leptonica-1.87.0/src/affine.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1027:5: call_function: calling ‘gaussjordan’ from ‘affineInvertXform’
# 1348|                           }
# 1349|                       } else if (ipiv[k] > 1) {
# 1350|->                         L_ERROR("singular matrix\n", __func__);
# 1351|                           success = FALSE;
# 1352|                           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
leptonica-1.87.0/src/affine.c:1350:25: warning[-Wanalyzer-malloc-leak]: leak of ‘a[3]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1348|                           }
# 1349|                       } else if (ipiv[k] > 1) {
# 1350|->                         L_ERROR("singular matrix\n", __func__);
# 1351|                           success = FALSE;
# 1352|                           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
leptonica-1.87.0/src/affine.c:1350:25: warning[-Wanalyzer-malloc-leak]: leak of ‘a[4]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1348|                           }
# 1349|                       } else if (ipiv[k] > 1) {
# 1350|->                         L_ERROR("singular matrix\n", __func__);
# 1351|                           success = FALSE;
# 1352|                           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
leptonica-1.87.0/src/affine.c:1350:25: warning[-Wanalyzer-malloc-leak]: leak of ‘a[5]’
leptonica-1.87.0/src/affine.c:915:1: enter_function: entry to ‘getAffineXformCoeffs’
leptonica-1.87.0/src/affine.c:924:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/affine.c:926:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:926:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/affine.c:928:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:928:8: branch_false: following ‘false’ branch (when ‘pvc’ is non-NULL)...
leptonica-1.87.0/src/affine.c:931:22: branch_false: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:941:17: branch_true: following ‘true’ branch (when ‘i != 6’)...
leptonica-1.87.0/src/affine.c:942:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:942:29: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:941:17: branch_false: following ‘false’ branch (when ‘i == 6’)...
leptonica-1.87.0/src/affine.c:943:5: branch_false: ...to here
leptonica-1.87.0/src/affine.c:962:5: call_function: calling ‘gaussjordan’ from ‘getAffineXformCoeffs’
# 1348|                           }
# 1349|                       } else if (ipiv[k] > 1) {
# 1350|->                         L_ERROR("singular matrix\n", __func__);
# 1351|                           success = FALSE;
# 1352|                           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
leptonica-1.87.0/src/affine.c:1350:25: warning[-Wanalyzer-malloc-leak]: leak of ‘indexc’
leptonica-1.87.0/src/affine.c:1322:8: branch_false: following ‘false’ branch (when ‘a’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1324:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1324:8: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1328:25: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1328:25: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1331:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:1338:17: branch_true: following ‘true’ branch (when ‘i < n’)...
leptonica-1.87.0/src/affine.c:1338:17: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1340:21: branch_true: following ‘true’ branch (when ‘j < n’)...
leptonica-1.87.0/src/affine.c:1341:21: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1342:29: branch_true: following ‘true’ branch (when ‘k < n’)...
leptonica-1.87.0/src/affine.c:1343:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1350:25: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1350:25: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1350:25: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/affine.c:1350:25: danger: ‘indexc’ leaks here; was allocated at [(5)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/4)
# 1348|                           }
# 1349|                       } else if (ipiv[k] > 1) {
# 1350|->                         L_ERROR("singular matrix\n", __func__);
# 1351|                           success = FALSE;
# 1352|                           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
leptonica-1.87.0/src/affine.c:1350:25: warning[-Wanalyzer-malloc-leak]: leak of ‘indexr’
leptonica-1.87.0/src/affine.c:1322:8: branch_false: following ‘false’ branch (when ‘a’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1324:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1324:8: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1328:25: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1329:25: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1331:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:1338:17: branch_true: following ‘true’ branch (when ‘i < n’)...
leptonica-1.87.0/src/affine.c:1338:17: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1340:21: branch_true: following ‘true’ branch (when ‘j < n’)...
leptonica-1.87.0/src/affine.c:1341:21: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1342:29: branch_true: following ‘true’ branch (when ‘k < n’)...
leptonica-1.87.0/src/affine.c:1343:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1350:25: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1350:25: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1350:25: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/affine.c:1350:25: danger: ‘indexr’ leaks here; was allocated at [(5)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/4)
# 1348|                           }
# 1349|                       } else if (ipiv[k] > 1) {
# 1350|->                         L_ERROR("singular matrix\n", __func__);
# 1351|                           success = FALSE;
# 1352|                           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
leptonica-1.87.0/src/affine.c:1350:25: warning[-Wanalyzer-malloc-leak]: leak of ‘ipiv’
leptonica-1.87.0/src/affine.c:1322:8: branch_false: following ‘false’ branch (when ‘a’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1324:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1324:8: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1328:25: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1330:23: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1331:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:1331:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1331:9: branch_false: following ‘false’ branch (when ‘ipiv’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1331:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1338:17: branch_true: following ‘true’ branch (when ‘i < n’)...
leptonica-1.87.0/src/affine.c:1338:17: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1340:21: branch_true: following ‘true’ branch (when ‘j < n’)...
leptonica-1.87.0/src/affine.c:1341:21: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1342:29: branch_true: following ‘true’ branch (when ‘k < n’)...
leptonica-1.87.0/src/affine.c:1343:29: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1350:25: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1350:25: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1350:25: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/affine.c:1350:25: danger: ‘ipiv’ leaks here; was allocated at [(5)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/4)
# 1348|                           }
# 1349|                       } else if (ipiv[k] > 1) {
# 1350|->                         L_ERROR("singular matrix\n", __func__);
# 1351|                           success = FALSE;
# 1352|                           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
leptonica-1.87.0/src/affine.c:1368:13: warning[-Wanalyzer-malloc-leak]: leak of ‘indexc’
leptonica-1.87.0/src/affine.c:1322:8: branch_false: following ‘false’ branch (when ‘a’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1324:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1324:8: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1328:25: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1328:25: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1331:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:1338:17: branch_true: following ‘true’ branch (when ‘i < n’)...
leptonica-1.87.0/src/affine.c:1338:17: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1340:21: branch_true: following ‘true’ branch (when ‘j < n’)...
leptonica-1.87.0/src/affine.c:1341:21: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1359:12: branch_false: following ‘false’ branch (when ‘icol == irow’)...
leptonica-1.87.0/src/affine.c:1365:15: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1367:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1368:13: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1368:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1368:13: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1368:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/affine.c:1368:13: danger: ‘indexc’ leaks here; was allocated at [(5)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/4)
# 1366|           indexc[i] = icol;
# 1367|           if (a[icol][icol] == 0.0) {
# 1368|->             L_ERROR("singular matrix\n", __func__);
# 1369|               success = FALSE;
# 1370|               goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
leptonica-1.87.0/src/affine.c:1368:13: warning[-Wanalyzer-malloc-leak]: leak of ‘indexr’
leptonica-1.87.0/src/affine.c:1322:8: branch_false: following ‘false’ branch (when ‘a’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1324:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1324:8: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1328:25: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1329:25: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1331:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:1338:17: branch_true: following ‘true’ branch (when ‘i < n’)...
leptonica-1.87.0/src/affine.c:1338:17: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1340:21: branch_true: following ‘true’ branch (when ‘j < n’)...
leptonica-1.87.0/src/affine.c:1341:21: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1359:12: branch_false: following ‘false’ branch (when ‘icol == irow’)...
leptonica-1.87.0/src/affine.c:1365:15: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1367:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1368:13: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1368:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1368:13: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1368:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/affine.c:1368:13: danger: ‘indexr’ leaks here; was allocated at [(5)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/4)
# 1366|           indexc[i] = icol;
# 1367|           if (a[icol][icol] == 0.0) {
# 1368|->             L_ERROR("singular matrix\n", __func__);
# 1369|               success = FALSE;
# 1370|               goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
leptonica-1.87.0/src/affine.c:1368:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ipiv’
leptonica-1.87.0/src/affine.c:1322:8: branch_false: following ‘false’ branch (when ‘a’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1324:8: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1324:8: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1328:25: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1330:23: acquire_memory: allocated here
leptonica-1.87.0/src/affine.c:1331:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/affine.c:1331:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1331:9: branch_false: following ‘false’ branch (when ‘ipiv’ is non-NULL)...
leptonica-1.87.0/src/affine.c:1331:9: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1338:17: branch_true: following ‘true’ branch (when ‘i < n’)...
leptonica-1.87.0/src/affine.c:1338:17: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1340:21: branch_true: following ‘true’ branch (when ‘j < n’)...
leptonica-1.87.0/src/affine.c:1341:21: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1359:12: branch_false: following ‘false’ branch (when ‘icol == irow’)...
leptonica-1.87.0/src/affine.c:1365:15: branch_false: ...to here
leptonica-1.87.0/src/affine.c:1367:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1368:13: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1368:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/affine.c:1368:13: branch_true: ...to here
leptonica-1.87.0/src/affine.c:1368:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/affine.c:1368:13: danger: ‘ipiv’ leaks here; was allocated at [(5)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/4)
# 1366|           indexc[i] = icol;
# 1367|           if (a[icol][icol] == 0.0) {
# 1368|->             L_ERROR("singular matrix\n", __func__);
# 1369|               success = FALSE;
# 1370|               goto cleanup_arrays;

Error: CPPCHECK_WARNING (CWE-476): [#def103]
leptonica-1.87.0/src/affinecompose.c:99: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#   97|   
#   98|       mat = (l_float32 *)LEPT_CALLOC(9, sizeof(l_float32));
#   99|->     mat[0] = mat[4] = mat[8] = 1;
#  100|       mat[2] = transx;
#  101|       mat[5] = transy;

Error: CPPCHECK_WARNING (CWE-476): [#def104]
leptonica-1.87.0/src/affinecompose.c:100: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#   98|       mat = (l_float32 *)LEPT_CALLOC(9, sizeof(l_float32));
#   99|       mat[0] = mat[4] = mat[8] = 1;
#  100|->     mat[2] = transx;
#  101|       mat[5] = transy;
#  102|       return mat;

Error: CPPCHECK_WARNING (CWE-476): [#def105]
leptonica-1.87.0/src/affinecompose.c:101: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#   99|       mat[0] = mat[4] = mat[8] = 1;
#  100|       mat[2] = transx;
#  101|->     mat[5] = transy;
#  102|       return mat;
#  103|   }

Error: CPPCHECK_WARNING (CWE-476): [#def106]
leptonica-1.87.0/src/affinecompose.c:136: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#  134|   
#  135|       mat = (l_float32 *)LEPT_CALLOC(9, sizeof(l_float32));
#  136|->     mat[0] = scalex;
#  137|       mat[4] = scaley;
#  138|       mat[8] = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def107]
leptonica-1.87.0/src/affinecompose.c:137: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#  135|       mat = (l_float32 *)LEPT_CALLOC(9, sizeof(l_float32));
#  136|       mat[0] = scalex;
#  137|->     mat[4] = scaley;
#  138|       mat[8] = 1;
#  139|       return mat;

Error: CPPCHECK_WARNING (CWE-476): [#def108]
leptonica-1.87.0/src/affinecompose.c:138: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#  136|       mat[0] = scalex;
#  137|       mat[4] = scaley;
#  138|->     mat[8] = 1;
#  139|       return mat;
#  140|   }

Error: CPPCHECK_WARNING (CWE-476): [#def109]
leptonica-1.87.0/src/affinecompose.c:189: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#  187|       sina = sin(angle);
#  188|       cosa = cos(angle);
#  189|->     mat[0] = mat[4] = cosa;
#  190|       mat[1] = -sina;
#  191|       mat[2] = xc * (1.0 - cosa) + yc * sina;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def110]
leptonica-1.87.0/src/affinecompose.c:189:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mat’
leptonica-1.87.0/src/affinecompose.c:186:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/affinecompose.c:189:14: danger: ‘mat’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  187|       sina = sin(angle);
#  188|       cosa = cos(angle);
#  189|->     mat[0] = mat[4] = cosa;
#  190|       mat[1] = -sina;
#  191|       mat[2] = xc * (1.0 - cosa) + yc * sina;

Error: CPPCHECK_WARNING (CWE-476): [#def111]
leptonica-1.87.0/src/affinecompose.c:190: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#  188|       cosa = cos(angle);
#  189|       mat[0] = mat[4] = cosa;
#  190|->     mat[1] = -sina;
#  191|       mat[2] = xc * (1.0 - cosa) + yc * sina;
#  192|       mat[3] = sina;

Error: CPPCHECK_WARNING (CWE-476): [#def112]
leptonica-1.87.0/src/affinecompose.c:191: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#  189|       mat[0] = mat[4] = cosa;
#  190|       mat[1] = -sina;
#  191|->     mat[2] = xc * (1.0 - cosa) + yc * sina;
#  192|       mat[3] = sina;
#  193|       mat[5] = yc * (1.0 - cosa) - xc * sina;

Error: CPPCHECK_WARNING (CWE-476): [#def113]
leptonica-1.87.0/src/affinecompose.c:192: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#  190|       mat[1] = -sina;
#  191|       mat[2] = xc * (1.0 - cosa) + yc * sina;
#  192|->     mat[3] = sina;
#  193|       mat[5] = yc * (1.0 - cosa) - xc * sina;
#  194|       mat[8] = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def114]
leptonica-1.87.0/src/affinecompose.c:193: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#  191|       mat[2] = xc * (1.0 - cosa) + yc * sina;
#  192|       mat[3] = sina;
#  193|->     mat[5] = yc * (1.0 - cosa) - xc * sina;
#  194|       mat[8] = 1;
#  195|       return mat;

Error: CPPCHECK_WARNING (CWE-476): [#def115]
leptonica-1.87.0/src/affinecompose.c:194: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mat
#  192|       mat[3] = sina;
#  193|       mat[5] = yc * (1.0 - cosa) - xc * sina;
#  194|->     mat[8] = 1;
#  195|       return mat;
#  196|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
leptonica-1.87.0/src/affinecompose.c:550:16: warning[-Wanalyzer-malloc-leak]: leak of ‘matt’
leptonica-1.87.0/src/affinecompose.c:616:1: enter_function: entry to ‘l_productMat4’
leptonica-1.87.0/src/affinecompose.c:625:8: branch_false: following ‘false’ branch (when ‘mat1’ is non-NULL)...
leptonica-1.87.0/src/affinecompose.c:627:8: branch_false: ...to here
leptonica-1.87.0/src/affinecompose.c:627:8: branch_false: following ‘false’ branch (when ‘mat2’ is non-NULL)...
leptonica-1.87.0/src/affinecompose.c:629:8: branch_false: ...to here
leptonica-1.87.0/src/affinecompose.c:629:8: branch_false: following ‘false’ branch (when ‘mat3’ is non-NULL)...
leptonica-1.87.0/src/affinecompose.c:631:8: branch_false: ...to here
leptonica-1.87.0/src/affinecompose.c:631:8: branch_false: following ‘false’ branch (when ‘matd’ is non-NULL)...
leptonica-1.87.0/src/affinecompose.c:634:30: branch_false: ...to here
leptonica-1.87.0/src/affinecompose.c:634:30: acquire_memory: allocated here
leptonica-1.87.0/src/affinecompose.c:634:8: branch_false: following ‘false’ branch (when ‘matt’ is non-NULL)...
leptonica-1.87.0/src/affinecompose.c:637:5: branch_false: ...to here
leptonica-1.87.0/src/affinecompose.c:637:5: call_function: calling ‘l_productMat3’ from ‘l_productMat4’
leptonica-1.87.0/src/affinecompose.c:637:5: return_function: returning to ‘l_productMat4’ from ‘l_productMat3’
leptonica-1.87.0/src/affinecompose.c:638:5: call_function: calling ‘l_productMat2’ from ‘l_productMat4’
#  548|           return ERROR_INT("matrix 1 not defined", __func__, 1);
#  549|       if (!mat2)
#  550|->         return ERROR_INT("matrix 2 not defined", __func__, 1);
#  551|       if (!matd)
#  552|           return ERROR_INT("result matrix not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def117]
leptonica-1.87.0/src/affinecompose.c:596:16: warning[-Wanalyzer-malloc-leak]: leak of ‘matt’
leptonica-1.87.0/src/affinecompose.c:616:1: enter_function: entry to ‘l_productMat4’
leptonica-1.87.0/src/affinecompose.c:625:8: branch_false: following ‘false’ branch (when ‘mat1’ is non-NULL)...
leptonica-1.87.0/src/affinecompose.c:627:8: branch_false: ...to here
leptonica-1.87.0/src/affinecompose.c:627:8: branch_false: following ‘false’ branch (when ‘mat2’ is non-NULL)...
leptonica-1.87.0/src/affinecompose.c:629:8: branch_false: ...to here
leptonica-1.87.0/src/affinecompose.c:629:8: branch_false: following ‘false’ branch (when ‘mat3’ is non-NULL)...
leptonica-1.87.0/src/affinecompose.c:631:8: branch_false: ...to here
leptonica-1.87.0/src/affinecompose.c:631:8: branch_false: following ‘false’ branch (when ‘matd’ is non-NULL)...
leptonica-1.87.0/src/affinecompose.c:634:30: branch_false: ...to here
leptonica-1.87.0/src/affinecompose.c:634:30: acquire_memory: allocated here
leptonica-1.87.0/src/affinecompose.c:634:8: branch_false: following ‘false’ branch (when ‘matt’ is non-NULL)...
leptonica-1.87.0/src/affinecompose.c:637:5: branch_false: ...to here
leptonica-1.87.0/src/affinecompose.c:637:5: call_function: calling ‘l_productMat3’ from ‘l_productMat4’
#  594|       if ((matt = (l_float32 *)LEPT_CALLOC((size_t)size * size,
#  595|                                            sizeof(l_float32))) == NULL)
#  596|->         return ERROR_INT("matt not made", __func__, 1);
#  597|       l_productMat2(mat1, mat2, matt, size);
#  598|       l_productMat2(matt, mat3, matd, size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
leptonica-1.87.0/src/bardecode.c:409:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:372:1: enter_function: entry to ‘barcodeDecode2of5’
leptonica-1.87.0/src/bardecode.c:379:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:383:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:383:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode2of5’
leptonica-1.87.0/src/bardecode.c:383:5: return_function: returning to ‘barcodeDecode2of5’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:384:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:386:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:393:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:400:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:401:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:403:17: branch_true: following ‘true’ branch (when ‘i < ndigits’)...
leptonica-1.87.0/src/bardecode.c:404:21: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:405:21: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/bardecode.c:406:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:405:21: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/bardecode.c:406:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:408:12: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:409:13: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:409:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:409:13: danger: ‘data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
#  407|   
#  408|           if (debugflag)
#  409|->             lept_stderr("code: %s\n", code);
#  410|   
#  411|           found = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def119]
leptonica-1.87.0/src/bardecode.c:414:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.87.0/src/bardecode.c:372:1: enter_function: entry to ‘barcodeDecode2of5’
leptonica-1.87.0/src/bardecode.c:379:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:383:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:383:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode2of5’
leptonica-1.87.0/src/bardecode.c:383:5: return_function: returning to ‘barcodeDecode2of5’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:384:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:386:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:393:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:400:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:401:20: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bardecode.c:403:17: branch_true: following ‘true’ branch (when ‘i < ndigits’)...
leptonica-1.87.0/src/bardecode.c:404:21: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:405:21: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/bardecode.c:406:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:408:12: branch_false: following ‘false’ branch (when ‘debugflag == 0’)...
leptonica-1.87.0/src/bardecode.c:412:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:412:21: branch_true: following ‘true’ branch (when ‘j != 10’)...
leptonica-1.87.0/src/bardecode.c:413:18: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:413:16: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/src/bardecode.c:414:27: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:414:17: danger: ‘data + (sizetype)i’ could be NULL: unchecked value from [(19)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/18)
#  412|           for (j = 0; j < 10; j++) {
#  413|               if (!strcmp(code, Code2of5[j])) {
#  414|->                 data[i] = 0x30 + j;
#  415|                   found = TRUE;
#  416|                   break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def120]
leptonica-1.87.0/src/bardecode.c:490:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:450:1: enter_function: entry to ‘barcodeDecodeI2of5’
leptonica-1.87.0/src/bardecode.c:457:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:461:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:461:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecodeI2of5’
leptonica-1.87.0/src/bardecode.c:461:5: return_function: returning to ‘barcodeDecodeI2of5’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:462:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:464:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:471:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:478:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:479:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:482:17: branch_true: following ‘true’ branch (when ‘i < npairs’)...
leptonica-1.87.0/src/bardecode.c:483:21: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:484:21: branch_true: following ‘true’ branch (when ‘j != 5’)...
leptonica-1.87.0/src/bardecode.c:485:40: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:484:21: branch_true: following ‘true’ branch (when ‘j != 5’)...
leptonica-1.87.0/src/bardecode.c:485:40: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:489:12: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:490:13: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:490:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:490:13: danger: ‘data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/18)
#  488|   
#  489|           if (debugflag)
#  490|->             lept_stderr("code1: %s, code2: %s\n", code1, code2);
#  491|   
#  492|           found = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def121]
leptonica-1.87.0/src/bardecode.c:495:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.87.0/src/bardecode.c:450:1: enter_function: entry to ‘barcodeDecodeI2of5’
leptonica-1.87.0/src/bardecode.c:457:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:461:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:461:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecodeI2of5’
leptonica-1.87.0/src/bardecode.c:461:5: return_function: returning to ‘barcodeDecodeI2of5’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:462:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:464:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:471:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:478:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:479:20: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bardecode.c:482:17: branch_true: following ‘true’ branch (when ‘i < npairs’)...
leptonica-1.87.0/src/bardecode.c:483:21: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:484:21: branch_true: following ‘true’ branch (when ‘j != 5’)...
leptonica-1.87.0/src/bardecode.c:485:40: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:489:12: branch_false: following ‘false’ branch (when ‘debugflag == 0’)...
leptonica-1.87.0/src/bardecode.c:493:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:493:21: branch_true: following ‘true’ branch (when ‘j != 10’)...
leptonica-1.87.0/src/bardecode.c:494:18: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:494:16: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/src/bardecode.c:495:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:495:17: danger: ‘data + (sizetype)(i * 2)’ could be NULL: unchecked value from [(19)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/18)
#  493|           for (j = 0; j < 10; j++) {
#  494|               if (!strcmp(code1, CodeI2of5[j])) {
#  495|->                 data[2 * i] = 0x30 + j;
#  496|                   found = TRUE;
#  497|                   break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def122]
leptonica-1.87.0/src/bardecode.c:586:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:576:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:580:17: branch_true: following ‘true’ branch (when ‘i < nsymb’)...
leptonica-1.87.0/src/bardecode.c:581:17: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:582:21: branch_true: following ‘true’ branch (when ‘j != 6’)...
leptonica-1.87.0/src/bardecode.c:583:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:582:21: branch_true: following ‘true’ branch (when ‘j != 6’)...
leptonica-1.87.0/src/bardecode.c:583:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:585:12: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:586:13: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:586:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:586:13: danger: ‘data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/18)
#  584|   
#  585|           if (debugflag)
#  586|->             lept_stderr("code: %s\n", code);
#  587|   
#  588|           found = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
leptonica-1.87.0/src/bardecode.c:586:13: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:577:24: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:580:17: branch_true: following ‘true’ branch (when ‘i < nsymb’)...
leptonica-1.87.0/src/bardecode.c:581:17: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:582:21: branch_true: following ‘true’ branch (when ‘j != 6’)...
leptonica-1.87.0/src/bardecode.c:583:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:582:21: branch_true: following ‘true’ branch (when ‘j != 6’)...
leptonica-1.87.0/src/bardecode.c:583:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:585:12: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:586:13: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:586:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:586:13: danger: ‘index’ leaks here; was allocated at [(19)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/18)
#  584|   
#  585|           if (debugflag)
#  586|->             lept_stderr("code: %s\n", code);
#  587|   
#  588|           found = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def124]
leptonica-1.87.0/src/bardecode.c:591:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:576:20: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bardecode.c:580:17: branch_true: following ‘true’ branch (when ‘i < nsymb’)...
leptonica-1.87.0/src/bardecode.c:581:17: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:582:21: branch_true: following ‘true’ branch (when ‘j != 6’)...
leptonica-1.87.0/src/bardecode.c:583:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:585:12: branch_false: following ‘false’ branch (when ‘debugflag == 0’)...
leptonica-1.87.0/src/bardecode.c:589:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:589:21: branch_true: following ‘true’ branch (when ‘j != 47’)...
leptonica-1.87.0/src/bardecode.c:590:18: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:590:16: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/src/bardecode.c:591:21: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:591:17: danger: ‘data + (sizetype)i’ could be NULL: unchecked value from [(19)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/18)
#  589|           for (j = 0; j < C93_START; j++) {
#  590|               if (!strcmp(code, Code93[j])) {
#  591|->                 data[i] = Code93Val[j];
#  592|                   index[i] = j;
#  593|                   found = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def125]
leptonica-1.87.0/src/bardecode.c:592:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘index’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:577:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bardecode.c:580:17: branch_true: following ‘true’ branch (when ‘i < nsymb’)...
leptonica-1.87.0/src/bardecode.c:581:17: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:582:21: branch_true: following ‘true’ branch (when ‘j != 6’)...
leptonica-1.87.0/src/bardecode.c:583:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:585:12: branch_false: following ‘false’ branch (when ‘debugflag == 0’)...
leptonica-1.87.0/src/bardecode.c:589:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:589:21: branch_true: following ‘true’ branch (when ‘j != 47’)...
leptonica-1.87.0/src/bardecode.c:590:18: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:590:16: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/src/bardecode.c:591:21: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:592:17: danger: ‘index + (sizetype)i * 4’ could be NULL: unchecked value from [(19)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/18)
#  590|               if (!strcmp(code, Code93[j])) {
#  591|                   data[i] = Code93Val[j];
#  592|->                 index[i] = j;
#  593|                   found = TRUE;
#  594|                   break;

Error: GCC_ANALYZER_WARNING (CWE-122): [#def126]
leptonica-1.87.0/src/bardecode.c:613:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: following ‘false’ branch (when ‘error == 0’)...
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:613:9: danger: read of 1 byte at offset ‘(long unsigned int)nsymb + 18446744073709551614’ exceeds the buffer
#  611|       for (i = 0; i < nsymb - 2; i++)  /* skip the "C" and "K" */
#  612|           sum += ((i % 20) + 1) * index[nsymb - 3 - i];
#  613|->     if (data[nsymb - 2] != Code93Val[sum % 47])
#  614|           L_WARNING("Error for check C\n", __func__);
#  615|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def127]
leptonica-1.87.0/src/bardecode.c:614:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:576:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: following ‘false’ branch (when ‘error == 0’)...
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:613:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bardecode.c:614:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:614:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bardecode.c:614:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:614:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:614:9: danger: ‘data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/18)
#  612|           sum += ((i % 20) + 1) * index[nsymb - 3 - i];
#  613|       if (data[nsymb - 2] != Code93Val[sum % 47])
#  614|->         L_WARNING("Error for check C\n", __func__);
#  615|   
#  616|       if (debugflag) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def128]
leptonica-1.87.0/src/bardecode.c:614:9: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:577:24: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: following ‘false’ branch (when ‘error == 0’)...
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:613:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bardecode.c:614:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:614:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bardecode.c:614:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:614:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:614:9: danger: ‘index’ leaks here; was allocated at [(19)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/18)
#  612|           sum += ((i % 20) + 1) * index[nsymb - 3 - i];
#  613|       if (data[nsymb - 2] != Code93Val[sum % 47])
#  614|->         L_WARNING("Error for check C\n", __func__);
#  615|   
#  616|       if (debugflag) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def129]
leptonica-1.87.0/src/bardecode.c:618:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:576:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: following ‘false’ branch (when ‘error == 0’)...
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:616:8: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:617:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:618:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:618:9: danger: ‘data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/18)
#  616|       if (debugflag) {
#  617|           checkc = Code93[sum % 47];
#  618|->         lept_stderr("checkc = %s\n", checkc);
#  619|       }
#  620|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
leptonica-1.87.0/src/bardecode.c:618:9: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:577:24: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: following ‘false’ branch (when ‘error == 0’)...
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:616:8: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:617:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:618:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:618:9: danger: ‘index’ leaks here; was allocated at [(19)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/18)
#  616|       if (debugflag) {
#  617|           checkc = Code93[sum % 47];
#  618|->         lept_stderr("checkc = %s\n", checkc);
#  619|       }
#  620|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
leptonica-1.87.0/src/bardecode.c:625:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:576:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: following ‘false’ branch (when ‘error == 0’)...
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:624:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bardecode.c:625:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:625:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bardecode.c:625:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:625:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:625:9: danger: ‘data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/18)
#  623|           sum += ((i % 15) + 1) * index[nsymb - 2 - i];
#  624|       if (data[nsymb - 1] != Code93Val[sum % 47])
#  625|->         L_WARNING("Error for check K\n", __func__);
#  626|   
#  627|       if (debugflag) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
leptonica-1.87.0/src/bardecode.c:625:9: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:577:24: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: following ‘false’ branch (when ‘error == 0’)...
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:624:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bardecode.c:625:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:625:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bardecode.c:625:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:625:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:625:9: danger: ‘index’ leaks here; was allocated at [(19)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/18)
#  623|           sum += ((i % 15) + 1) * index[nsymb - 2 - i];
#  624|       if (data[nsymb - 1] != Code93Val[sum % 47])
#  625|->         L_WARNING("Error for check K\n", __func__);
#  626|   
#  627|       if (debugflag) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def133]
leptonica-1.87.0/src/bardecode.c:629:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:576:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: following ‘false’ branch (when ‘error == 0’)...
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:627:8: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:628:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:629:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:629:9: danger: ‘data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/18)
#  627|       if (debugflag) {
#  628|           checkk = Code93[sum % 47];
#  629|->         lept_stderr("checkk = %s\n", checkk);
#  630|       }
#  631|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def134]
leptonica-1.87.0/src/bardecode.c:629:9: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:577:24: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: following ‘false’ branch (when ‘error == 0’)...
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:627:8: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:628:9: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:629:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:629:9: danger: ‘index’ leaks here; was allocated at [(19)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/18)
#  627|       if (debugflag) {
#  628|           checkk = Code93[sum % 47];
#  629|->         lept_stderr("checkk = %s\n", checkk);
#  630|       }
#  631|   

Error: GCC_ANALYZER_WARNING (CWE-122): [#def135]
leptonica-1.87.0/src/bardecode.c:633:5: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
leptonica-1.87.0/src/bardecode.c:545:1: enter_function: entry to ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:554:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:558:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:558:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode93’
leptonica-1.87.0/src/bardecode.c:558:5: return_function: returning to ‘barcodeDecode93’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:559:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:561:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:568:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:575:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: following ‘false’ branch (when ‘error == 0’)...
leptonica-1.87.0/src/bardecode.c:601:8: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:633:5: danger: out-of-bounds write
#  631|   
#  632|           /* Remove the two check codes from the output */
#  633|->     data[nsymb - 2] = '\0';
#  634|   
#  635|       LEPT_FREE(index);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def136]
leptonica-1.87.0/src/bardecode.c:698:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:660:1: enter_function: entry to ‘barcodeDecode39’
leptonica-1.87.0/src/bardecode.c:667:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:671:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:671:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode39’
leptonica-1.87.0/src/bardecode.c:671:5: return_function: returning to ‘barcodeDecode39’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:672:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:674:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:681:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:688:13: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:689:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:692:17: branch_true: following ‘true’ branch (when ‘i < nsymb’)...
leptonica-1.87.0/src/bardecode.c:693:17: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:694:21: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/bardecode.c:695:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:694:21: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/bardecode.c:695:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:697:12: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:698:13: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:698:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:698:13: danger: ‘data’ leaks here; was allocated at [(19)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/18)
#  696|   
#  697|           if (debugflag)
#  698|->             lept_stderr("code: %s\n", code);
#  699|   
#  700|           found = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def137]
leptonica-1.87.0/src/bardecode.c:703:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.87.0/src/bardecode.c:660:1: enter_function: entry to ‘barcodeDecode39’
leptonica-1.87.0/src/bardecode.c:667:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:671:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:671:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecode39’
leptonica-1.87.0/src/bardecode.c:671:5: return_function: returning to ‘barcodeDecode39’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:672:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:674:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:681:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:688:13: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:689:20: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bardecode.c:692:17: branch_true: following ‘true’ branch (when ‘i < nsymb’)...
leptonica-1.87.0/src/bardecode.c:693:17: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:694:21: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/bardecode.c:695:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:697:12: branch_false: following ‘false’ branch (when ‘debugflag == 0’)...
leptonica-1.87.0/src/bardecode.c:701:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:701:21: branch_true: following ‘true’ branch (when ‘j != 43’)...
leptonica-1.87.0/src/bardecode.c:702:18: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:702:16: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/src/bardecode.c:703:21: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:703:17: danger: ‘data + (sizetype)i’ could be NULL: unchecked value from [(19)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/18)
#  701|           for (j = 0; j < C39_START; j++) {
#  702|               if (!strcmp(code, Code39[j])) {
#  703|->                 data[i] = Code39Val[j];
#  704|                   found = TRUE;
#  705|                   break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
leptonica-1.87.0/src/bardecode.c:780:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:741:1: enter_function: entry to ‘barcodeDecodeCodabar’
leptonica-1.87.0/src/bardecode.c:748:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:752:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:752:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecodeCodabar’
leptonica-1.87.0/src/bardecode.c:752:5: return_function: returning to ‘barcodeDecodeCodabar’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:753:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:756:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:763:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:770:13: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:771:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:774:17: branch_true: following ‘true’ branch (when ‘i < nsymb’)...
leptonica-1.87.0/src/bardecode.c:775:17: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:776:21: branch_true: following ‘true’ branch (when ‘j != 7’)...
leptonica-1.87.0/src/bardecode.c:777:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:776:21: branch_true: following ‘true’ branch (when ‘j != 7’)...
leptonica-1.87.0/src/bardecode.c:777:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:779:12: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:780:13: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:780:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:780:13: danger: ‘data’ leaks here; was allocated at [(27)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/26)
#  778|   
#  779|           if (debugflag)
#  780|->             lept_stderr("code: %s\n", code);
#  781|   
#  782|           found = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def139]
leptonica-1.87.0/src/bardecode.c:785:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.87.0/src/bardecode.c:741:1: enter_function: entry to ‘barcodeDecodeCodabar’
leptonica-1.87.0/src/bardecode.c:748:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:752:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:752:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecodeCodabar’
leptonica-1.87.0/src/bardecode.c:752:5: return_function: returning to ‘barcodeDecodeCodabar’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:753:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:756:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:763:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:770:13: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:771:20: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bardecode.c:774:17: branch_true: following ‘true’ branch (when ‘i < nsymb’)...
leptonica-1.87.0/src/bardecode.c:775:17: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:776:21: branch_true: following ‘true’ branch (when ‘j != 7’)...
leptonica-1.87.0/src/bardecode.c:777:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:779:12: branch_false: following ‘false’ branch (when ‘debugflag == 0’)...
leptonica-1.87.0/src/bardecode.c:783:9: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:783:21: branch_true: following ‘true’ branch (when ‘j != 16’)...
leptonica-1.87.0/src/bardecode.c:784:18: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:784:16: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/src/bardecode.c:785:21: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:785:17: danger: ‘data + (sizetype)i’ could be NULL: unchecked value from [(27)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/26)
#  783|           for (j = 0; j < 16; j++) {
#  784|               if (!strcmp(code, Codabar[j])) {
#  785|->                 data[i] = CodabarVal[j];
#  786|                   found = TRUE;
#  787|                   break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
leptonica-1.87.0/src/bardecode.c:877:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:827:1: enter_function: entry to ‘barcodeDecodeUpca’
leptonica-1.87.0/src/bardecode.c:834:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:838:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:838:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecodeUpca’
leptonica-1.87.0/src/bardecode.c:838:5: return_function: returning to ‘barcodeDecodeUpca’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:839:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:843:11: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:844:8: branch_false: following ‘false’ branch (when ‘len == 59’)...
leptonica-1.87.0/src/bardecode.c:849:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:850:17: branch_true: following ‘true’ branch (when ‘i != 4’)...
leptonica-1.87.0/src/bardecode.c:850:17: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:853:17: branch_true: following ‘true’ branch (when ‘i != 10’)...
leptonica-1.87.0/src/bardecode.c:854:14: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:865:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:868:17: branch_true: following ‘true’ branch (when ‘i != 12’)...
leptonica-1.87.0/src/bardecode.c:869:12: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:869:12: branch_true: following ‘true’ branch (when ‘i <= 5’)...
leptonica-1.87.0/src/bardecode.c:870:25: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:873:21: branch_true: following ‘true’ branch (when ‘j != 4’)...
leptonica-1.87.0/src/bardecode.c:874:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:876:12: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:877:13: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:877:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:877:13: danger: ‘data’ leaks here; was allocated at [(23)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/22)
#  875|   
#  876|           if (debugflag)
#  877|->             lept_stderr("code: %s\n", code);
#  878|   
#  879|           found = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
leptonica-1.87.0/src/bardecode.c:995:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/bardecode.c:942:1: enter_function: entry to ‘barcodeDecodeEan13’
leptonica-1.87.0/src/bardecode.c:950:8: branch_false: following ‘false’ branch (when ‘barstr’ is non-NULL)...
leptonica-1.87.0/src/bardecode.c:956:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:956:5: call_function: calling ‘barcodeVerifyFormat’ from ‘barcodeDecodeEan13’
leptonica-1.87.0/src/bardecode.c:956:5: return_function: returning to ‘barcodeDecodeEan13’ from ‘barcodeVerifyFormat’
leptonica-1.87.0/src/bardecode.c:957:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bardecode.c:961:11: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:962:8: branch_false: following ‘false’ branch (when ‘len == 59’)...
leptonica-1.87.0/src/bardecode.c:967:5: branch_false: ...to here
leptonica-1.87.0/src/bardecode.c:968:17: branch_true: following ‘true’ branch (when ‘i != 4’)...
leptonica-1.87.0/src/bardecode.c:968:17: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:971:17: branch_true: following ‘true’ branch (when ‘i != 10’)...
leptonica-1.87.0/src/bardecode.c:972:14: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:983:20: acquire_memory: allocated here
leptonica-1.87.0/src/bardecode.c:986:17: branch_true: following ‘true’ branch (when ‘i != 12’)...
leptonica-1.87.0/src/bardecode.c:987:12: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:987:12: branch_true: following ‘true’ branch (when ‘i <= 5’)...
leptonica-1.87.0/src/bardecode.c:988:25: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:991:21: branch_true: following ‘true’ branch (when ‘j != 4’)...
leptonica-1.87.0/src/bardecode.c:992:31: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:994:12: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/bardecode.c:995:13: branch_true: ...to here
leptonica-1.87.0/src/bardecode.c:995:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/bardecode.c:995:13: danger: ‘data’ leaks here; was allocated at [(23)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/22)
#  993|   
#  994|           if (debugflag)
#  995|->             lept_stderr("code: %s\n", code);
#  996|   
#  997|           found = FALSE;

Error: CPPCHECK_WARNING (CWE-457): [#def142]
leptonica-1.87.0/src/baseline.c:510: warning[uninitvar]: Uninitialized variable: dely
#  508|       }
#  509|       ptaAddPt(ptas, 0, i);
#  510|->     ptaAddPt(ptas, w - 1, i - dely);
#  511|       ptaAddPt(ptad, 0, i);
#  512|       ptaAddPt(ptad, w - 1, i);

Error: COMPILER_WARNING (CWE-457): [#def143]
leptonica-1.87.0/src/baseline.c: scope_hint: In function ‘pixGetLocalSkewTransform’
leptonica-1.87.0/src/baseline.c:510:5: warning[-Wmaybe-uninitialized]: ‘dely’ may be used uninitialized
#  510 |     ptaAddPt(ptas, w - 1, i - dely);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/baseline.c:465:33: note: ‘dely’ was declared here
#  465 | l_float32  deg2rad, angr, angd, dely;
#      |                                 ^~~~
#  508|       }
#  509|       ptaAddPt(ptas, 0, i);
#  510|->     ptaAddPt(ptas, w - 1, i - dely);
#  511|       ptaAddPt(ptad, 0, i);
#  512|       ptaAddPt(ptad, w - 1, i);

Error: CPPCHECK_WARNING (CWE-476): [#def144]
leptonica-1.87.0/src/bbuffer.c:139: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bb
#  137|   
#  138|       bb = (L_BBUFFER *)LEPT_CALLOC(1, sizeof(L_BBUFFER));
#  139|->     if ((bb->array = (l_uint8 *)LEPT_CALLOC(nalloc, sizeof(l_uint8))) == NULL) {
#  140|           LEPT_FREE(bb);
#  141|           return (L_BBUFFER *)ERROR_PTR("byte array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def145]
leptonica-1.87.0/src/bbuffer.c:139:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bb’
leptonica-1.87.0/src/bbuffer.c:138:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bbuffer.c:139:9: danger: ‘bb’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  137|   
#  138|       bb = (L_BBUFFER *)LEPT_CALLOC(1, sizeof(L_BBUFFER));
#  139|->     if ((bb->array = (l_uint8 *)LEPT_CALLOC(nalloc, sizeof(l_uint8))) == NULL) {
#  140|           LEPT_FREE(bb);
#  141|           return (L_BBUFFER *)ERROR_PTR("byte array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def146]
leptonica-1.87.0/src/bbuffer.c:143: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bb
#  141|           return (L_BBUFFER *)ERROR_PTR("byte array not made", __func__, NULL);
#  142|       }
#  143|->     bb->nalloc = nalloc;
#  144|       bb->nwritten = 0;
#  145|   

Error: CPPCHECK_WARNING (CWE-476): [#def147]
leptonica-1.87.0/src/bbuffer.c:144: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bb
#  142|       }
#  143|       bb->nalloc = nalloc;
#  144|->     bb->nwritten = 0;
#  145|   
#  146|       if (indata) {

Error: CPPCHECK_WARNING (CWE-476): [#def148]
leptonica-1.87.0/src/bilateral.c:330: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bil
#  328|   
#  329|       bil = (L_BILATERAL *)LEPT_CALLOC(1, sizeof(L_BILATERAL));
#  330|->     bil->spatial_stdev = sstdev;
#  331|       bil->range_stdev = range_stdev;
#  332|       bil->reduction = reduction;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def149]
leptonica-1.87.0/src/bilateral.c:330:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bil’
leptonica-1.87.0/src/bilateral.c:317:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:320:30: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:326:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:329:26: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:329:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bilateral.c:330:5: danger: ‘bil’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  328|   
#  329|       bil = (L_BILATERAL *)LEPT_CALLOC(1, sizeof(L_BILATERAL));
#  330|->     bil->spatial_stdev = sstdev;
#  331|       bil->range_stdev = range_stdev;
#  332|       bil->reduction = reduction;

Error: CPPCHECK_WARNING (CWE-476): [#def150]
leptonica-1.87.0/src/bilateral.c:331: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bil
#  329|       bil = (L_BILATERAL *)LEPT_CALLOC(1, sizeof(L_BILATERAL));
#  330|       bil->spatial_stdev = sstdev;
#  331|->     bil->range_stdev = range_stdev;
#  332|       bil->reduction = reduction;
#  333|       bil->ncomps = ncomps;

Error: CPPCHECK_WARNING (CWE-476): [#def151]
leptonica-1.87.0/src/bilateral.c:332: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bil
#  330|       bil->spatial_stdev = sstdev;
#  331|       bil->range_stdev = range_stdev;
#  332|->     bil->reduction = reduction;
#  333|       bil->ncomps = ncomps;
#  334|       bil->minval = minval;

Error: CPPCHECK_WARNING (CWE-476): [#def152]
leptonica-1.87.0/src/bilateral.c:333: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bil
#  331|       bil->range_stdev = range_stdev;
#  332|       bil->reduction = reduction;
#  333|->     bil->ncomps = ncomps;
#  334|       bil->minval = minval;
#  335|       bil->maxval = maxval;

Error: CPPCHECK_WARNING (CWE-476): [#def153]
leptonica-1.87.0/src/bilateral.c:334: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bil
#  332|       bil->reduction = reduction;
#  333|       bil->ncomps = ncomps;
#  334|->     bil->minval = minval;
#  335|       bil->maxval = maxval;
#  336|       bil->pixsc = pixsc;

Error: CPPCHECK_WARNING (CWE-476): [#def154]
leptonica-1.87.0/src/bilateral.c:335: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bil
#  333|       bil->ncomps = ncomps;
#  334|       bil->minval = minval;
#  335|->     bil->maxval = maxval;
#  336|       bil->pixsc = pixsc;
#  337|       bil->pixs = pixClone(pixs);

Error: CPPCHECK_WARNING (CWE-476): [#def155]
leptonica-1.87.0/src/bilateral.c:336: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bil
#  334|       bil->minval = minval;
#  335|       bil->maxval = maxval;
#  336|->     bil->pixsc = pixsc;
#  337|       bil->pixs = pixClone(pixs);
#  338|   

Error: CPPCHECK_WARNING (CWE-476): [#def156]
leptonica-1.87.0/src/bilateral.c:337: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bil
#  335|       bil->maxval = maxval;
#  336|       bil->pixsc = pixsc;
#  337|->     bil->pixs = pixClone(pixs);
#  338|   
#  339|       /* -------------------------------------------------------------------- *

Error: GCC_ANALYZER_WARNING (CWE-401): [#def157]
leptonica-1.87.0/src/bilateral.c:337:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bil’
leptonica-1.87.0/src/bilateral.c:317:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:320:30: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:326:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:329:26: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:329:26: acquire_memory: allocated here
leptonica-1.87.0/src/bilateral.c:337:17: throw: if ‘pixClone’ throws an exception...
leptonica-1.87.0/src/bilateral.c:337:17: danger: ‘bil’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  335|       bil->maxval = maxval;
#  336|       bil->pixsc = pixsc;
#  337|->     bil->pixs = pixClone(pixs);
#  338|   
#  339|       /* -------------------------------------------------------------------- *

Error: CPPCHECK_WARNING (CWE-476): [#def158]
leptonica-1.87.0/src/bilateral.c:348: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: nc
#  346|       nc = (l_int32 *)LEPT_CALLOC(ncomps, sizeof(l_int32));
#  347|       for (i = 0; i < ncomps; i++)
#  348|->         nc[i] = minval + i * (maxval - minval) / (ncomps - 1);
#  349|       bil->nc = nc;
#  350|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def159]
leptonica-1.87.0/src/bilateral.c:348:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘nc’
leptonica-1.87.0/src/bilateral.c:317:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:320:30: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:326:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:329:26: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:346:21: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bilateral.c:347:17: branch_true: following ‘true’ branch (when ‘i < ncomps’)...
leptonica-1.87.0/src/bilateral.c:348:30: branch_true: ...to here
leptonica-1.87.0/src/bilateral.c:348:9: danger: ‘nc + (long unsigned int)i * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  346|       nc = (l_int32 *)LEPT_CALLOC(ncomps, sizeof(l_int32));
#  347|       for (i = 0; i < ncomps; i++)
#  348|->         nc[i] = minval + i * (maxval - minval) / (ncomps - 1);
#  349|       bil->nc = nc;
#  350|   

Error: CPPCHECK_WARNING (CWE-476): [#def160]
leptonica-1.87.0/src/bilateral.c:349: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bil
#  347|       for (i = 0; i < ncomps; i++)
#  348|           nc[i] = minval + i * (maxval - minval) / (ncomps - 1);
#  349|->     bil->nc = nc;
#  350|   
#  351|           /* kindex maps from intensity I(x) to the lower k index for J(k,x) */

Error: CPPCHECK_WARNING (CWE-476): [#def161]
leptonica-1.87.0/src/bilateral.c:354: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: nc
#  352|       kindex = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  353|       for (i = minval, k = 0; i <= maxval && k < ncomps - 1; k++) {
#  354|->         fval2 = nc[k + 1];
#  355|           while (i < fval2) {
#  356|               kindex[i] = k;

Error: CPPCHECK_WARNING (CWE-476): [#def162]
leptonica-1.87.0/src/bilateral.c:356: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: kindex
#  354|           fval2 = nc[k + 1];
#  355|           while (i < fval2) {
#  356|->             kindex[i] = k;
#  357|               i++;
#  358|           }

Error: CPPCHECK_WARNING (CWE-476): [#def163]
leptonica-1.87.0/src/bilateral.c:360: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: kindex
#  358|           }
#  359|       }
#  360|->     kindex[maxval] = ncomps - 2;
#  361|       bil->kindex = kindex;
#  362|   

Error: CPPCHECK_WARNING (CWE-476): [#def164]
leptonica-1.87.0/src/bilateral.c:361: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bil
#  359|       }
#  360|       kindex[maxval] = ncomps - 2;
#  361|->     bil->kindex = kindex;
#  362|   
#  363|           /* kfract maps from intensity I(x) to the fraction of J(k+1,x) used */

Error: CPPCHECK_WARNING (CWE-476): [#def165]
leptonica-1.87.0/src/bilateral.c:366: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: nc
#  364|       kfract = (l_float32 *)LEPT_CALLOC(256, sizeof(l_float32));  /* from lower */
#  365|       for (i = minval, k = 0; i <= maxval && k < ncomps - 1; k++) {
#  366|->         fval1 = nc[k];
#  367|           fval2 = nc[k + 1];
#  368|           while (i < fval2) {

Error: CPPCHECK_WARNING (CWE-476): [#def166]
leptonica-1.87.0/src/bilateral.c:367: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: nc
#  365|       for (i = minval, k = 0; i <= maxval && k < ncomps - 1; k++) {
#  366|           fval1 = nc[k];
#  367|->         fval2 = nc[k + 1];
#  368|           while (i < fval2) {
#  369|               kfract[i] = (l_float32)(i - fval1) / (l_float32)(fval2 - fval1);

Error: CPPCHECK_WARNING (CWE-476): [#def167]
leptonica-1.87.0/src/bilateral.c:369: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: kfract
#  367|           fval2 = nc[k + 1];
#  368|           while (i < fval2) {
#  369|->             kfract[i] = (l_float32)(i - fval1) / (l_float32)(fval2 - fval1);
#  370|               i++;
#  371|           }

Error: CPPCHECK_WARNING (CWE-476): [#def168]
leptonica-1.87.0/src/bilateral.c:373: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: kfract
#  371|           }
#  372|       }
#  373|->     kfract[maxval] = 1.0;
#  374|       bil->kfract = kfract;
#  375|   

Error: GCC_ANALYZER_WARNING: [#def169]
leptonica-1.87.0/src/bilateral.c:388:28: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.87.0/src/bilateral.c:317:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:320:30: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:326:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:329:26: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:347:17: branch_false: following ‘false’ branch (when ‘i >= ncomps’)...
leptonica-1.87.0/src/bilateral.c:349:5: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:388:28: danger: operand ‘spatial_stdev’ is of type ‘l_float32’ {{aka ‘float’}}
#  386|        * -------------------------------------------------------------------- */
#  387|       spatial_size = 2 * sstdev + 1;  /* same as the added border */
#  388|->     spatial = (l_float32 *)LEPT_CALLOC(spatial_size, sizeof(l_float32));
#  389|       denom = 2. * sstdev * sstdev;
#  390|       for (i = 0; i < spatial_size; i++)

Error: CPPCHECK_WARNING (CWE-476): [#def170]
leptonica-1.87.0/src/bilateral.c:391: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: spatial
#  389|       denom = 2. * sstdev * sstdev;
#  390|       for (i = 0; i < spatial_size; i++)
#  391|->         spatial[i] = expf(-(l_float32)(i * i) / denom);
#  392|       bil->spatial = spatial;
#  393|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def171]
leptonica-1.87.0/src/bilateral.c:391:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘spatial’
leptonica-1.87.0/src/bilateral.c:317:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:320:30: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:326:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:329:26: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:347:17: branch_false: following ‘false’ branch (when ‘i >= ncomps’)...
leptonica-1.87.0/src/bilateral.c:349:5: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:388:28: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bilateral.c:390:17: branch_true: following ‘true’ branch (when ‘i < border’)...
leptonica-1.87.0/src/bilateral.c:391:39: branch_true: ...to here
leptonica-1.87.0/src/bilateral.c:391:9: danger: ‘spatial + (long unsigned int)i * 4’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  389|       denom = 2. * sstdev * sstdev;
#  390|       for (i = 0; i < spatial_size; i++)
#  391|->         spatial[i] = expf(-(l_float32)(i * i) / denom);
#  392|       bil->spatial = spatial;
#  393|   

Error: CPPCHECK_WARNING (CWE-476): [#def172]
leptonica-1.87.0/src/bilateral.c:397: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: range
#  395|       denom = 2. * range_stdev * range_stdev;
#  396|       for (i = 0; i < 256; i++)
#  397|->         range[i] = expf(-(l_float32)(i * i) / denom);
#  398|       bil->range = range;
#  399|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def173]
leptonica-1.87.0/src/bilateral.c:397:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘range’
leptonica-1.87.0/src/bilateral.c:317:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:320:30: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:326:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bilateral.c:329:26: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:347:17: branch_false: following ‘false’ branch (when ‘i >= ncomps’)...
leptonica-1.87.0/src/bilateral.c:349:5: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:390:17: branch_true: following ‘true’ branch (when ‘i < border’)...
leptonica-1.87.0/src/bilateral.c:391:39: branch_true: ...to here
leptonica-1.87.0/src/bilateral.c:390:17: branch_false: following ‘false’ branch (when ‘i >= border’)...
leptonica-1.87.0/src/bilateral.c:392:5: branch_false: ...to here
leptonica-1.87.0/src/bilateral.c:394:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bilateral.c:396:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/bilateral.c:397:37: branch_true: ...to here
leptonica-1.87.0/src/bilateral.c:397:9: danger: ‘range + (long unsigned int)i * 4’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/10)
#  395|       denom = 2. * range_stdev * range_stdev;
#  396|       for (i = 0; i < 256; i++)
#  397|->         range[i] = expf(-(l_float32)(i * i) / denom);
#  398|       bil->range = range;
#  399|   

Error: COMPILER_WARNING (CWE-457): [#def174]
leptonica-1.87.0/src/binarize.c: scope_hint: In function ‘pixSauvolaBinarize’
leptonica-1.87.0/src/binarize.c:716:47: warning[-Wmaybe-uninitialized]: ‘wplsd’ may be used uninitialized
#  716 | l_int32     i, j, w, h, tabsize, wplm, wplms, wplsd, wpld, usetab;
#      |                                               ^~~~~
#  714|                          PIX      **ppixsd)
#  715|   {
#  716|-> l_int32     i, j, w, h, tabsize, wplm, wplms, wplsd, wpld, usetab;
#  717|   l_int32     mv, ms, var, thresh;
#  718|   l_uint32   *datam, *datams, *datasd = NULL, *datad;

Error: CPPCHECK_WARNING (CWE-476): [#def175]
leptonica-1.87.0/src/binarize.c:743: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
#  741|           tab = (l_float32 *)LEPT_CALLOC(tabsize, sizeof(l_float32));
#  742|           for (i = 0; i < tabsize; i++)
#  743|->             tab[i] = sqrtf((l_float32)i);
#  744|       }
#  745|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def176]
leptonica-1.87.0/src/binarize.c:743:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/binarize.c:725:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/binarize.c:727:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/binarize.c:729:8: branch_false: ...to here
leptonica-1.87.0/src/binarize.c:729:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/binarize.c:732:8: branch_false: following ‘false’ branch (when ‘factor >= 0.0f’)...
leptonica-1.87.0/src/binarize.c:737:5: branch_false: ...to here
leptonica-1.87.0/src/binarize.c:739:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/binarize.c:741:28: branch_true: ...to here
leptonica-1.87.0/src/binarize.c:741:28: acquire_memory: this call could return NULL
leptonica-1.87.0/src/binarize.c:742:21: branch_true: following ‘true’ branch (when ‘i != 65536’)...
leptonica-1.87.0/src/binarize.c:743:22: branch_true: ...to here
leptonica-1.87.0/src/binarize.c:743:13: danger: ‘tab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  741|           tab = (l_float32 *)LEPT_CALLOC(tabsize, sizeof(l_float32));
#  742|           for (i = 0; i < tabsize; i++)
#  743|->             tab[i] = sqrtf((l_float32)i);
#  744|       }
#  745|   

Error: CPPCHECK_WARNING (CWE-476): [#def177]
leptonica-1.87.0/src/binreduce.c:392: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
#  390|       tab = (l_uint8 *) LEPT_CALLOC(256, sizeof(l_uint8));
#  391|       for (i = 0; i < 256; i++) {
#  392|->         tab[i] = ((i & 0x01)     ) |    /* 7 */
#  393|                    ((i & 0x04) >> 1) |    /* 6 */
#  394|                    ((i & 0x10) >> 2) |    /* 5 */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def178]
leptonica-1.87.0/src/binreduce.c:392:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/binreduce.c:390:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/binreduce.c:391:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/binreduce.c:392:18: branch_true: ...to here
leptonica-1.87.0/src/binreduce.c:392:9: danger: ‘tab + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  390|       tab = (l_uint8 *) LEPT_CALLOC(256, sizeof(l_uint8));
#  391|       for (i = 0; i < 256; i++) {
#  392|->         tab[i] = ((i & 0x01)     ) |    /* 7 */
#  393|                    ((i & 0x04) >> 1) |    /* 6 */
#  394|                    ((i & 0x10) >> 2) |    /* 5 */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def179]
leptonica-1.87.0/src/blend.c:2227:27: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘xmin’
leptonica-1.87.0/src/blend.c:2176:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/blend.c:2178:9: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2178:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2180:5: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2181:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2183:9: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2183:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2186:9: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2186:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2188:8: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2188:8: branch_false: following ‘false’ branch (when ‘maxfade > 0.0’)...
leptonica-1.87.0/src/blend.c:2189:8: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2189:8: branch_false: following ‘false’ branch (when ‘maxfade <= 1.0e+0f’)...
leptonica-1.87.0/src/blend.c:2191:8: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2191:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2195:8: branch_false: following ‘false’ branch (when ‘distfract <= 1.0e+0f’)...
leptonica-1.87.0/src/blend.c:2199:8: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2199:8: branch_false: following ‘false’ branch (when ‘dir != 0’)...
leptonica-1.87.0/src/blend.c:2203:15: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2203:15: branch_false: following ‘false’ branch (when ‘dir != 1’)...
leptonica-1.87.0/src/blend.c:2207:15: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2220:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/blend.c:2220:8: branch_true: ...to here
leptonica-1.87.0/src/blend.c:2221:21: branch_true: following ‘true’ branch (when ‘j < range’)...
leptonica-1.87.0/src/blend.c:2222:19: branch_true: ...to here
leptonica-1.87.0/src/blend.c:2222:19: branch_false: following ‘false’ branch (when ‘dir != 0’)...
leptonica-1.87.0/src/blend.c:2223:60: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2226:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/blend.c:2227:27: branch_true: ...to here
leptonica-1.87.0/src/blend.c:2227:27: danger: use of uninitialized value ‘xmin’ here
# 2225|                   line = data + i * wpl;
# 2226|                   if (d == 8) {
# 2227|->                     val = GET_DATA_BYTE(line, xmin + j);
# 2228|                       val += (limit - val) * del + 0.5;
# 2229|                       SET_DATA_BYTE(line, xmin + j, val);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def180]
leptonica-1.87.0/src/blend.c:2231:52: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘xmin’
leptonica-1.87.0/src/blend.c:2176:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/blend.c:2178:9: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2178:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2180:5: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2181:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2183:9: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2183:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2186:9: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2186:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2188:8: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2188:8: branch_false: following ‘false’ branch (when ‘maxfade > 0.0’)...
leptonica-1.87.0/src/blend.c:2189:8: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2189:8: branch_false: following ‘false’ branch (when ‘maxfade <= 1.0e+0f’)...
leptonica-1.87.0/src/blend.c:2191:8: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2191:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2195:8: branch_false: following ‘false’ branch (when ‘distfract <= 1.0e+0f’)...
leptonica-1.87.0/src/blend.c:2199:8: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2199:8: branch_false: following ‘false’ branch (when ‘dir != 0’)...
leptonica-1.87.0/src/blend.c:2203:15: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2203:15: branch_false: following ‘false’ branch (when ‘dir != 1’)...
leptonica-1.87.0/src/blend.c:2207:15: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2220:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/blend.c:2220:8: branch_true: ...to here
leptonica-1.87.0/src/blend.c:2221:21: branch_true: following ‘true’ branch (when ‘j < range’)...
leptonica-1.87.0/src/blend.c:2222:19: branch_true: ...to here
leptonica-1.87.0/src/blend.c:2222:19: branch_false: following ‘false’ branch (when ‘dir != 0’)...
leptonica-1.87.0/src/blend.c:2223:60: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2226:20: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/blend.c:2231:52: branch_false: ...to here
leptonica-1.87.0/src/blend.c:2231:52: danger: use of uninitialized value ‘xmin’ here
# 2229|                       SET_DATA_BYTE(line, xmin + j, val);
# 2230|                   } else {  /* rgb */
# 2231|->                     extractRGBValues(*(line + xmin + j), &rval, &gval, &bval);
# 2232|                       rval += (limit - rval) * del + 0.5;
# 2233|                       gval += (limit - gval) * del + 0.5;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def181]
leptonica-1.87.0/src/bmf.c:153:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bmf’
leptonica-1.87.0/src/bmf.c:118:1: enter_function: entry to ‘bmfCreate’
leptonica-1.87.0/src/bmf.c:124:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bmf.c:128:20: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bmf.c:130:8: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
leptonica-1.87.0/src/bmf.c:134:16: branch_false: ...to here
leptonica-1.87.0/src/bmf.c:134:16: call_function: calling ‘pixaGetFont’ from ‘bmfCreate’
leptonica-1.87.0/src/bmf.c:134:16: return_function: returning to ‘bmfCreate’ from ‘pixaGetFont’
leptonica-1.87.0/src/bmf.c:136:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bmf.c:153:8: branch_false: ...to here
leptonica-1.87.0/src/bmf.c:153:5: danger: ‘bmf’ could be NULL: unchecked value from [(4)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/3)
#  151|       }
#  152|   
#  153|->     bmf->pixa = pixa;
#  154|       bmf->size = fontsize;
#  155|       if (dir) bmf->directory = stringNew(dir);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def182]
leptonica-1.87.0/src/bmf.c:181:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bmf’
leptonica-1.87.0/src/bmf.c:118:1: enter_function: entry to ‘bmfCreate’
leptonica-1.87.0/src/bmf.c:124:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bmf.c:128:20: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bmf.c:130:8: branch_false: following ‘false’ branch (when ‘dir’ is non-NULL)...
leptonica-1.87.0/src/bmf.c:134:16: branch_false: ...to here
leptonica-1.87.0/src/bmf.c:136:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bmf.c:137:13: branch_true: ...to here
leptonica-1.87.0/src/bmf.c:138:20: call_function: calling ‘pixaGenerateFontFromFile’ from ‘bmfCreate’
leptonica-1.87.0/src/bmf.c:138:20: return_function: returning to ‘bmfCreate’ from ‘pixaGenerateFontFromFile’
leptonica-1.87.0/src/bmf.c:140:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bmf.c:141:17: branch_true: ...to here
leptonica-1.87.0/src/bmf.c:142:24: call_function: calling ‘pixaGenerateFontFromString’ from ‘bmfCreate’
leptonica-1.87.0/src/bmf.c:142:24: return_function: returning to ‘bmfCreate’ from ‘pixaGenerateFontFromString’
leptonica-1.87.0/src/bmf.c:148:8: branch_true: following ‘true’ branch (when ‘pixa’ is NULL)...
leptonica-1.87.0/src/bmf.c:149:9: branch_true: ...to here
leptonica-1.87.0/src/bmf.c:149:9: call_function: calling ‘bmfDestroy’ from ‘bmfCreate’
#  179|   
#  180|       pixaDestroy(&bmf->pixa);
#  181|->     LEPT_FREE(bmf->directory);
#  182|       LEPT_FREE(bmf->fonttab);
#  183|       LEPT_FREE(bmf->baselinetab);

Error: COMPILER_WARNING (CWE-457): [#def183]
leptonica-1.87.0/src/bmf.c: scope_hint: In function ‘pixaGenerateFont’
leptonica-1.87.0/src/bmf.c:610:21: warning[-Wmaybe-uninitialized]: ‘yval’ may be used uninitialized
#  610 |         baseline[i] = yval;
#      |         ~~~~~~~~~~~~^~~~~~
leptonica-1.87.0/src/bmf.c:552:46: note: ‘yval’ was declared here
#  552 | l_int32   i, j, nrows, nrowchars, nchars, h, yval;
#      |                                              ^~~~
#  608|           pixr = pixClipRectangle(pixs, box, NULL);  /* row of chars */
#  609|           pixGetTextBaseline(pixr, tab, &yval);
#  610|->         baseline[i] = yval;
#  611|   
#  612|   #if DEBUG_BASELINE

Error: CPPCHECK_WARNING (CWE-476): [#def184]
leptonica-1.87.0/src/bmf.c:798: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fonttab
#  796|       bmf->fonttab = fonttab;
#  797|       for (i = 0; i < 128; i++)
#  798|->         fonttab[i] = UNDEF;
#  799|       for (i = 32; i < 127; i++)
#  800|           fonttab[i] = i - 32;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def185]
leptonica-1.87.0/src/bmf.c:798:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fonttab’
leptonica-1.87.0/src/bmf.c:791:8: branch_false: following ‘false’ branch (when ‘bmf’ is non-NULL)...
leptonica-1.87.0/src/bmf.c:795:26: branch_false: ...to here
leptonica-1.87.0/src/bmf.c:795:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bmf.c:797:17: branch_true: following ‘true’ branch (when ‘i != 128’)...
leptonica-1.87.0/src/bmf.c:798:16: branch_true: ...to here
leptonica-1.87.0/src/bmf.c:798:9: danger: ‘fonttab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  796|       bmf->fonttab = fonttab;
#  797|       for (i = 0; i < 128; i++)
#  798|->         fonttab[i] = UNDEF;
#  799|       for (i = 32; i < 127; i++)
#  800|           fonttab[i] = i - 32;

Error: CPPCHECK_WARNING (CWE-476): [#def186]
leptonica-1.87.0/src/bmf.c:800: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fonttab
#  798|           fonttab[i] = UNDEF;
#  799|       for (i = 32; i < 127; i++)
#  800|->         fonttab[i] = i - 32;
#  801|   
#  802|       baselinetab = (l_int32 *)LEPT_CALLOC(128, sizeof(l_int32));

Error: CPPCHECK_WARNING (CWE-476): [#def187]
leptonica-1.87.0/src/bmf.c:805: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: baselinetab
#  803|       bmf->baselinetab = baselinetab;
#  804|       for (i = 0; i < 128; i++)
#  805|->         baselinetab[i] = UNDEF;
#  806|       for (i = 32; i <= 57; i++)
#  807|           baselinetab[i] = bmf->baseline1;

Error: CPPCHECK_WARNING (CWE-476): [#def188]
leptonica-1.87.0/src/bmf.c:807: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: baselinetab
#  805|           baselinetab[i] = UNDEF;
#  806|       for (i = 32; i <= 57; i++)
#  807|->         baselinetab[i] = bmf->baseline1;
#  808|       for (i = 58; i <= 91; i++)
#  809|           baselinetab[i] = bmf->baseline2;

Error: CPPCHECK_WARNING (CWE-476): [#def189]
leptonica-1.87.0/src/bmf.c:809: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: baselinetab
#  807|           baselinetab[i] = bmf->baseline1;
#  808|       for (i = 58; i <= 91; i++)
#  809|->         baselinetab[i] = bmf->baseline2;
#  810|       baselinetab[92] = bmf->baseline1;  /* the '\' char */
#  811|       for (i = 93; i < 127; i++)

Error: CPPCHECK_WARNING (CWE-476): [#def190]
leptonica-1.87.0/src/bmf.c:810: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: baselinetab
#  808|       for (i = 58; i <= 91; i++)
#  809|           baselinetab[i] = bmf->baseline2;
#  810|->     baselinetab[92] = bmf->baseline1;  /* the '\' char */
#  811|       for (i = 93; i < 127; i++)
#  812|           baselinetab[i] = bmf->baseline3;

Error: CPPCHECK_WARNING (CWE-476): [#def191]
leptonica-1.87.0/src/bmf.c:812: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: baselinetab
#  810|       baselinetab[92] = bmf->baseline1;  /* the '\' char */
#  811|       for (i = 93; i < 127; i++)
#  812|->         baselinetab[i] = bmf->baseline3;
#  813|   
#  814|           /* Get the line height of text characters, from the highest

Error: COMPILER_WARNING (CWE-563): [#def192]
leptonica-1.87.0/src/bmfdata.h:50:21: warning[-Wunused-variable]: ‘inputfonts’ defined but not used
#   50 | static const char  *inputfonts[] = {"chars-4.tif", "chars-6.tif",
#      |                     ^~~~~~~~~~
#   48|   
#   49|   #define  NUM_FONTS  9
#   50|-> static const char  *inputfonts[] = {"chars-4.tif", "chars-6.tif",
#   51|                                       "chars-8.tif", "chars-10.tif",
#   52|                                       "chars-12.tif", "chars-14.tif",

Error: COMPILER_WARNING (CWE-563): [#def193]
leptonica-1.87.0/prog/recog_bootnum1.c:62: included_from: Included from here.
leptonica-1.87.0/src/bmfdata.h:55:21: warning[-Wunused-variable]: ‘outputfonts’ defined but not used
#   55 | static const char  *outputfonts[] = {"chars-4.pa", "chars-6.pa",
#      |                     ^~~~~~~~~~~
#   53|                                       "chars-16.tif", "chars-18.tif",
#   54|                                       "chars-20.tif"};
#   55|-> static const char  *outputfonts[] = {"chars-4.pa", "chars-6.pa",
#   56|                                        "chars-8.pa", "chars-10.pa",
#   57|                                        "chars-12.pa", "chars-14.pa",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def194]
leptonica-1.87.0/src/bmpio.c:554:46: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pquad’
leptonica-1.87.0/src/bmpio.c:476:8: branch_true: following ‘true’ branch (when ‘pfsize’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:476:17: branch_true: ...to here
leptonica-1.87.0/src/bmpio.c:477:8: branch_false: following ‘false’ branch (when ‘pfdata’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:479:8: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:479:8: branch_false: following ‘false’ branch (when ‘pfsize’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:481:8: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:481:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:485:17: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:526:8: branch_false: following ‘false’ branch (when ‘fimagebytes <= 1600000000’)...
leptonica-1.87.0/src/bmpio.c:533:9: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:533:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bmpio.c:536:24: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:536:15: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bmpio.c:541:13: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:541:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bmpio.c:546:13: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:549:30: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bmpio.c:552:18: branch_true: following ‘true’ branch (when ‘i < ncolors’)...
leptonica-1.87.0/src/bmpio.c:554:46: branch_true: ...to here
leptonica-1.87.0/src/bmpio.c:554:46: danger: ‘pquad’ could be NULL: unchecked value from [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16)
#  552|                    i < ncolors;
#  553|                    i++, val += stepsize, pquad++) {
#  554|->                 pquad->blue = pquad->green = pquad->red = val;
#  555|                   pquad->alpha = 255;  /* opaque */
#  556|               }

Error: CPPCHECK_WARNING (CWE-476): [#def195]
leptonica-1.87.0/src/bmpio.c:579: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmpfh
#  577|           /* Write little-endian file header data */
#  578|       bmpfh = (BMP_FH *)fdata;
#  579|->     bmpfh->bfType[0] = (l_uint8)(BMP_ID >> 0);
#  580|       bmpfh->bfType[1] = (l_uint8)(BMP_ID >> 8);
#  581|       bmpfh->bfSize[0] = (l_uint8)(fsize >>  0);

Error: CPPCHECK_WARNING (CWE-476): [#def196]
leptonica-1.87.0/src/bmpio.c:580: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmpfh
#  578|       bmpfh = (BMP_FH *)fdata;
#  579|       bmpfh->bfType[0] = (l_uint8)(BMP_ID >> 0);
#  580|->     bmpfh->bfType[1] = (l_uint8)(BMP_ID >> 8);
#  581|       bmpfh->bfSize[0] = (l_uint8)(fsize >>  0);
#  582|       bmpfh->bfSize[1] = (l_uint8)(fsize >>  8);

Error: CPPCHECK_WARNING (CWE-476): [#def197]
leptonica-1.87.0/src/bmpio.c:581: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmpfh
#  579|       bmpfh->bfType[0] = (l_uint8)(BMP_ID >> 0);
#  580|       bmpfh->bfType[1] = (l_uint8)(BMP_ID >> 8);
#  581|->     bmpfh->bfSize[0] = (l_uint8)(fsize >>  0);
#  582|       bmpfh->bfSize[1] = (l_uint8)(fsize >>  8);
#  583|       bmpfh->bfSize[2] = (l_uint8)(fsize >> 16);

Error: CPPCHECK_WARNING (CWE-476): [#def198]
leptonica-1.87.0/src/bmpio.c:582: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmpfh
#  580|       bmpfh->bfType[1] = (l_uint8)(BMP_ID >> 8);
#  581|       bmpfh->bfSize[0] = (l_uint8)(fsize >>  0);
#  582|->     bmpfh->bfSize[1] = (l_uint8)(fsize >>  8);
#  583|       bmpfh->bfSize[2] = (l_uint8)(fsize >> 16);
#  584|       bmpfh->bfSize[3] = (l_uint8)(fsize >> 24);

Error: CPPCHECK_WARNING (CWE-476): [#def199]
leptonica-1.87.0/src/bmpio.c:583: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmpfh
#  581|       bmpfh->bfSize[0] = (l_uint8)(fsize >>  0);
#  582|       bmpfh->bfSize[1] = (l_uint8)(fsize >>  8);
#  583|->     bmpfh->bfSize[2] = (l_uint8)(fsize >> 16);
#  584|       bmpfh->bfSize[3] = (l_uint8)(fsize >> 24);
#  585|       bmpfh->bfOffBits[0] = (l_uint8)(offbytes >>  0);

Error: CPPCHECK_WARNING (CWE-476): [#def200]
leptonica-1.87.0/src/bmpio.c:584: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmpfh
#  582|       bmpfh->bfSize[1] = (l_uint8)(fsize >>  8);
#  583|       bmpfh->bfSize[2] = (l_uint8)(fsize >> 16);
#  584|->     bmpfh->bfSize[3] = (l_uint8)(fsize >> 24);
#  585|       bmpfh->bfOffBits[0] = (l_uint8)(offbytes >>  0);
#  586|       bmpfh->bfOffBits[1] = (l_uint8)(offbytes >>  8);

Error: CPPCHECK_WARNING (CWE-476): [#def201]
leptonica-1.87.0/src/bmpio.c:585: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmpfh
#  583|       bmpfh->bfSize[2] = (l_uint8)(fsize >> 16);
#  584|       bmpfh->bfSize[3] = (l_uint8)(fsize >> 24);
#  585|->     bmpfh->bfOffBits[0] = (l_uint8)(offbytes >>  0);
#  586|       bmpfh->bfOffBits[1] = (l_uint8)(offbytes >>  8);
#  587|       bmpfh->bfOffBits[2] = (l_uint8)(offbytes >> 16);

Error: CPPCHECK_WARNING (CWE-476): [#def202]
leptonica-1.87.0/src/bmpio.c:586: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmpfh
#  584|       bmpfh->bfSize[3] = (l_uint8)(fsize >> 24);
#  585|       bmpfh->bfOffBits[0] = (l_uint8)(offbytes >>  0);
#  586|->     bmpfh->bfOffBits[1] = (l_uint8)(offbytes >>  8);
#  587|       bmpfh->bfOffBits[2] = (l_uint8)(offbytes >> 16);
#  588|       bmpfh->bfOffBits[3] = (l_uint8)(offbytes >> 24);

Error: CPPCHECK_WARNING (CWE-476): [#def203]
leptonica-1.87.0/src/bmpio.c:587: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmpfh
#  585|       bmpfh->bfOffBits[0] = (l_uint8)(offbytes >>  0);
#  586|       bmpfh->bfOffBits[1] = (l_uint8)(offbytes >>  8);
#  587|->     bmpfh->bfOffBits[2] = (l_uint8)(offbytes >> 16);
#  588|       bmpfh->bfOffBits[3] = (l_uint8)(offbytes >> 24);
#  589|   

Error: CPPCHECK_WARNING (CWE-476): [#def204]
leptonica-1.87.0/src/bmpio.c:588: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmpfh
#  586|       bmpfh->bfOffBits[1] = (l_uint8)(offbytes >>  8);
#  587|       bmpfh->bfOffBits[2] = (l_uint8)(offbytes >> 16);
#  588|->     bmpfh->bfOffBits[3] = (l_uint8)(offbytes >> 24);
#  589|   
#  590|           /* Convert to little-endian and write the info header data */

Error: CPPCHECK_WARNING (CWE-682): [#def205]
leptonica-1.87.0/src/bmpio.c:602: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  600|       bmpih.biClrUsed = convertOnBigEnd32(ncolors);
#  601|       bmpih.biClrImportant = convertOnBigEnd32(ncolors);
#  602|->     memcpy(fdata + BMP_FHBYTES, &bmpih, BMP_IHBYTES);
#  603|   
#  604|           /* Copy the colormap data and free the cta if necessary */

Error: CPPCHECK_WARNING (CWE-682): [#def206]
leptonica-1.87.0/src/bmpio.c:620: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  618|   
#  619|           /* Transfer the image data.  Image origin for bmp is at lower right. */
#  620|->     fmdata = fdata + offbytes;
#  621|       if (fdepth != 24 && fdepth != 32) {   /* typ 1 or 8 bpp */
#  622|           data = (l_uint8 *)pixGetData(pix) + pixBpl * (h - 1);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def207]
leptonica-1.87.0/src/bmpio.c:650:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘&pel’
leptonica-1.87.0/src/bmpio.c:476:8: branch_true: following ‘true’ branch (when ‘pfsize’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:476:17: branch_true: ...to here
leptonica-1.87.0/src/bmpio.c:477:8: branch_false: following ‘false’ branch (when ‘pfdata’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:479:8: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:479:8: branch_false: following ‘false’ branch (when ‘pfsize’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:481:8: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:481:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:485:17: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:526:8: branch_false: following ‘false’ branch (when ‘fimagebytes <= 1600000000’)...
leptonica-1.87.0/src/bmpio.c:533:9: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:605:8: branch_false: following ‘false’ branch (when ‘ncolors <= 0’)...
leptonica-1.87.0/src/bmpio.c:612:9: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:621:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bmpio.c:640:29: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:642:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bmpio.c:642:21: branch_true: ...to here
leptonica-1.87.0/src/bmpio.c:650:17: danger: use of uninitialized value ‘&pel’ here
#  648|                   if (spp == 4)
#  649|                       pel[3] = *((l_uint8 *)pword + L_ALPHA_CHANNEL);
#  650|->                 memcpy(fmdata, &pel, spp);
#  651|                   fmdata += spp;
#  652|               }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def208]
leptonica-1.87.0/src/bmpio.c:655:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(unsigned char *)(&pel[0])’
leptonica-1.87.0/src/bmpio.c:476:8: branch_true: following ‘true’ branch (when ‘pfsize’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:476:17: branch_true: ...to here
leptonica-1.87.0/src/bmpio.c:477:8: branch_false: following ‘false’ branch (when ‘pfdata’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:479:8: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:479:8: branch_false: following ‘false’ branch (when ‘pfsize’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:481:8: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:481:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/bmpio.c:485:17: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:526:8: branch_false: following ‘false’ branch (when ‘fimagebytes <= 1600000000’)...
leptonica-1.87.0/src/bmpio.c:533:9: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:605:8: branch_false: following ‘false’ branch (when ‘ncolors <= 0’)...
leptonica-1.87.0/src/bmpio.c:612:9: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:621:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bmpio.c:640:29: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:642:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bmpio.c:642:21: branch_true: ...to here
leptonica-1.87.0/src/bmpio.c:643:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/bmpio.c:653:16: branch_false: ...to here
leptonica-1.87.0/src/bmpio.c:655:21: danger: use of uninitialized value ‘*(unsigned char *)(&pel[0])’ here
#  653|               if (extrabytes) {
#  654|                   for (k = 0; k < extrabytes; k++) {
#  655|->                     memcpy(fmdata, &pel, 1);
#  656|                       fmdata++;
#  657|                   }

Error: CPPCHECK_WARNING (CWE-476): [#def209]
leptonica-1.87.0/src/boxbasic.c:195: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: box
#  193|       box = (BOX *)LEPT_CALLOC(1, sizeof(BOX));
#  194|       boxSetGeometry(box, x, y, w, h);
#  195|->     box->refcount = 1;
#  196|       return box;
#  197|   }

Error: CPPCHECK_WARNING (CWE-476): [#def210]
leptonica-1.87.0/src/boxbasic.c:450: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: boxa
#  448|   
#  449|       boxa = (BOXA *)LEPT_CALLOC(1, sizeof(BOXA));
#  450|->     boxa->n = 0;
#  451|       boxa->nalloc = n;
#  452|       boxa->refcount = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def211]
leptonica-1.87.0/src/boxbasic.c:450:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘boxa’
leptonica-1.87.0/src/boxbasic.c:2018:1: enter_function: entry to ‘boxaReadStream’
leptonica-1.87.0/src/boxbasic.c:2028:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxbasic.c:2030:9: branch_false: ...to here
leptonica-1.87.0/src/boxbasic.c:2030:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxbasic.c:2032:9: branch_false: ...to here
leptonica-1.87.0/src/boxbasic.c:2032:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxbasic.c:2034:9: branch_false: ...to here
leptonica-1.87.0/src/boxbasic.c:2034:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxbasic.c:2036:9: branch_false: ...to here
leptonica-1.87.0/src/boxbasic.c:2036:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxbasic.c:2038:8: branch_false: ...to here
leptonica-1.87.0/src/boxbasic.c:2040:17: call_function: calling ‘boxaCreate’ from ‘boxaReadStream’
#  448|   
#  449|       boxa = (BOXA *)LEPT_CALLOC(1, sizeof(BOXA));
#  450|->     boxa->n = 0;
#  451|       boxa->nalloc = n;
#  452|       boxa->refcount = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def212]
leptonica-1.87.0/src/boxbasic.c:451: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: boxa
#  449|       boxa = (BOXA *)LEPT_CALLOC(1, sizeof(BOXA));
#  450|       boxa->n = 0;
#  451|->     boxa->nalloc = n;
#  452|       boxa->refcount = 1;
#  453|       if ((boxa->box = (BOX **)LEPT_CALLOC(n, sizeof(BOX *))) == NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def213]
leptonica-1.87.0/src/boxbasic.c:452: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: boxa
#  450|       boxa->n = 0;
#  451|       boxa->nalloc = n;
#  452|->     boxa->refcount = 1;
#  453|       if ((boxa->box = (BOX **)LEPT_CALLOC(n, sizeof(BOX *))) == NULL) {
#  454|           boxaDestroy(&boxa);

Error: CPPCHECK_WARNING (CWE-476): [#def214]
leptonica-1.87.0/src/boxbasic.c:453: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: boxa
#  451|       boxa->nalloc = n;
#  452|       boxa->refcount = 1;
#  453|->     if ((boxa->box = (BOX **)LEPT_CALLOC(n, sizeof(BOX *))) == NULL) {
#  454|           boxaDestroy(&boxa);
#  455|           return (BOXA *)ERROR_PTR("boxa ptrs not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def215]
leptonica-1.87.0/src/boxbasic.c:1153: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: baa
# 1151|   
# 1152|       baa = (BOXAA *)LEPT_CALLOC(1, sizeof(BOXAA));
# 1153|->     if ((baa->boxa = (BOXA **)LEPT_CALLOC(n, sizeof(BOXA *))) == NULL) {
# 1154|           boxaaDestroy(&baa);
# 1155|           return (BOXAA *)ERROR_PTR("boxa ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def216]
leptonica-1.87.0/src/boxbasic.c:1153:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘baa’
leptonica-1.87.0/src/boxbasic.c:1787:1: enter_function: entry to ‘boxaaReadStream’
leptonica-1.87.0/src/boxbasic.c:1797:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxbasic.c:1799:9: branch_false: ...to here
leptonica-1.87.0/src/boxbasic.c:1799:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxbasic.c:1801:9: branch_false: ...to here
leptonica-1.87.0/src/boxbasic.c:1801:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxbasic.c:1803:9: branch_false: ...to here
leptonica-1.87.0/src/boxbasic.c:1803:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxbasic.c:1805:9: branch_false: ...to here
leptonica-1.87.0/src/boxbasic.c:1805:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxbasic.c:1807:8: branch_false: ...to here
leptonica-1.87.0/src/boxbasic.c:1809:16: call_function: calling ‘boxaaCreate’ from ‘boxaaReadStream’
# 1151|   
# 1152|       baa = (BOXAA *)LEPT_CALLOC(1, sizeof(BOXAA));
# 1153|->     if ((baa->boxa = (BOXA **)LEPT_CALLOC(n, sizeof(BOXA *))) == NULL) {
# 1154|           boxaaDestroy(&baa);
# 1155|           return (BOXAA *)ERROR_PTR("boxa ptr array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def217]
leptonica-1.87.0/src/boxbasic.c:1157: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: baa
# 1155|           return (BOXAA *)ERROR_PTR("boxa ptr array not made", __func__, NULL);
# 1156|       }
# 1157|->     baa->nalloc = n;
# 1158|       baa->n = 0;
# 1159|       return baa;

Error: CPPCHECK_WARNING (CWE-476): [#def218]
leptonica-1.87.0/src/boxbasic.c:1158: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: baa
# 1156|       }
# 1157|       baa->nalloc = n;
# 1158|->     baa->n = 0;
# 1159|       return baa;
# 1160|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def219]
leptonica-1.87.0/src/boxfunc2.c:332:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.87.0/src/boxfunc2.c:306:8: branch_false: following ‘false’ branch (when ‘boxs’ is non-NULL)...
leptonica-1.87.0/src/boxfunc2.c:308:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:308:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:312:5: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:313:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: following ‘false’ branch (when ‘angle == 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:327:12: branch_false: following ‘false’ branch (when ‘angle != 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:330:20: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:332:18: danger: use of uninitialized value ‘cosa’ here
#  330|               xdif = tx + 0.5 * tw - xcent;
#  331|               ydif = ty + 0.5 * th - ycent;
#  332|->             rw = L_ABS(tw * cosa) + L_ABS(th * sina);
#  333|               rh = L_ABS(th * cosa) + L_ABS(tw * sina);
#  334|               rx = xcent + xdif * cosa - ydif * sina - 0.5 * rw;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def220]
leptonica-1.87.0/src/boxfunc2.c:351:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.87.0/src/boxfunc2.c:306:8: branch_false: following ‘false’ branch (when ‘boxs’ is non-NULL)...
leptonica-1.87.0/src/boxfunc2.c:308:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:308:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:312:5: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:313:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: following ‘false’ branch (when ‘angle == 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:346:12: branch_false: following ‘false’ branch (when ‘angle != 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:349:20: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:351:18: danger: use of uninitialized value ‘cosa’ here
#  349|               xdif = tx + 0.5 * tw - xcent;
#  350|               ydif = ty + 0.5 * th - ycent;
#  351|->             rw = L_ABS(tw * cosa) + L_ABS(th * sina);
#  352|               rh = L_ABS(th * cosa) + L_ABS(tw * sina);
#  353|               rx = xcent + xdif * cosa - ydif * sina - 0.5 * rw;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def221]
leptonica-1.87.0/src/boxfunc2.c:367:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.87.0/src/boxfunc2.c:306:8: branch_false: following ‘false’ branch (when ‘boxs’ is non-NULL)...
leptonica-1.87.0/src/boxfunc2.c:308:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:308:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:312:5: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:313:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: following ‘false’ branch (when ‘angle == 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:359:12: branch_false: following ‘false’ branch (when ‘angle != 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:365:20: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:367:18: danger: use of uninitialized value ‘cosa’ here
#  365|               xdif = bx + 0.5 * bw - xcen;
#  366|               ydif = by + 0.5 * bh - ycen;
#  367|->             rw = L_ABS(bw * cosa) + L_ABS(bh * sina);
#  368|               rh = L_ABS(bh * cosa) + L_ABS(bw * sina);
#  369|               rx = xcen + xdif * cosa - ydif * sina - 0.5 * rw;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def222]
leptonica-1.87.0/src/boxfunc2.c:386:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.87.0/src/boxfunc2.c:306:8: branch_false: following ‘false’ branch (when ‘boxs’ is non-NULL)...
leptonica-1.87.0/src/boxfunc2.c:308:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:308:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:312:5: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:313:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: following ‘false’ branch (when ‘angle == 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:378:12: branch_false: following ‘false’ branch (when ‘angle != 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:384:20: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:386:18: danger: use of uninitialized value ‘cosa’ here
#  384|               xdif = bx + 0.5 * bw - xcen;
#  385|               ydif = by + 0.5 * bh - ycen;
#  386|->             rw = L_ABS(bw * cosa) + L_ABS(bh * sina);
#  387|               rh = L_ABS(bh * cosa) + L_ABS(bw * sina);
#  388|               rx = xcen + xdif * cosa - ydif * sina - 0.5 * rw;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def223]
leptonica-1.87.0/src/boxfunc2.c:407:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.87.0/src/boxfunc2.c:306:8: branch_false: following ‘false’ branch (when ‘boxs’ is non-NULL)...
leptonica-1.87.0/src/boxfunc2.c:308:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:308:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:312:5: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:313:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: following ‘false’ branch (when ‘angle == 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:399:12: branch_false: following ‘false’ branch (when ‘angle != 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:405:20: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:407:18: danger: use of uninitialized value ‘cosa’ here
#  405|               xdif = tx + 0.5 * bw - xcen;
#  406|               ydif = ty + 0.5 * bh - ycen;
#  407|->             rw = L_ABS(bw * cosa) + L_ABS(bh * sina);
#  408|               rh = L_ABS(bh * cosa) + L_ABS(bw * sina);
#  409|               rx = xcen + xdif * cosa - ydif * sina - 0.5 * rw;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def224]
leptonica-1.87.0/src/boxfunc2.c:432:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘cosa’
leptonica-1.87.0/src/boxfunc2.c:306:8: branch_false: following ‘false’ branch (when ‘boxs’ is non-NULL)...
leptonica-1.87.0/src/boxfunc2.c:308:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:308:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:312:5: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:313:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: following ‘false’ branch (when ‘angle == 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:315:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:424:12: branch_false: following ‘false’ branch (when ‘angle != 0.0f’)...
leptonica-1.87.0/src/boxfunc2.c:430:20: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:432:18: danger: use of uninitialized value ‘cosa’ here
#  430|               xdif = tx + 0.5 * tw - xcent;
#  431|               ydif = ty + 0.5 * th - ycent;
#  432|->             rw = L_ABS(tw * cosa) + L_ABS(th * sina);
#  433|               rh = L_ABS(th * cosa) + L_ABS(tw * sina);
#  434|               rx = xcent + xdif * cosa - ydif * sina - 0.5 * rw;

Error: CPPCHECK_WARNING (CWE-457): [#def225]
leptonica-1.87.0/src/boxfunc2.c:1807: warning[uninitvar]: Uninitialized variable: nbox
# 1805|   
# 1806|           /* baad[i][j] = baas[j][i] */
# 1807|->     baad = boxaaCreate(nbox);
# 1808|       for (i = 0; i < nbox; i++) {
# 1809|           boxa = boxaCreate(ny);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def226]
leptonica-1.87.0/src/boxfunc2.c:1807:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nbox’
leptonica-1.87.0/src/boxfunc2.c:1788:8: branch_false: following ‘false’ branch (when ‘baas’ is non-NULL)...
leptonica-1.87.0/src/boxfunc2.c:1790:15: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:1790:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:1790:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:1794:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc2.c:1807:12: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:1807:12: danger: use of uninitialized value ‘nbox’ here
# 1805|   
# 1806|           /* baad[i][j] = baas[j][i] */
# 1807|->     baad = boxaaCreate(nbox);
# 1808|       for (i = 0; i < nbox; i++) {
# 1809|           boxa = boxaCreate(ny);

Error: COMPILER_WARNING (CWE-457): [#def227]
leptonica-1.87.0/src/boxfunc2.c: scope_hint: In function ‘boxaaTranspose’
leptonica-1.87.0/src/boxfunc2.c:1807:12: warning[-Wmaybe-uninitialized]: ‘nbox’ may be used uninitialized
# 1807 |     baad = boxaaCreate(nbox);
#      |            ^~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/boxfunc2.c:1783:25: note: ‘nbox’ was declared here
# 1783 | l_int32   i, j, ny, nb, nbox;
#      |                         ^~~~
# 1805|   
# 1806|           /* baad[i][j] = baas[j][i] */
# 1807|->     baad = boxaaCreate(nbox);
# 1808|       for (i = 0; i < nbox; i++) {
# 1809|           boxa = boxaCreate(ny);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def228]
leptonica-1.87.0/src/boxfunc2.c:1882:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘maxindex’
leptonica-1.87.0/src/boxfunc2.c:1848:8: branch_false: following ‘false’ branch (when ‘baa’ is non-NULL)...
leptonica-1.87.0/src/boxfunc2.c:1850:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:1850:8: branch_false: following ‘false’ branch (when ‘box’ is non-NULL)...
leptonica-1.87.0/src/boxfunc2.c:1852:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:1852:8: branch_false: following ‘false’ branch (when ‘pindex’ is non-NULL)...
leptonica-1.87.0/src/boxfunc2.c:1855:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc2.c:1881:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/boxfunc2.c:1882:9: branch_true: ...to here
leptonica-1.87.0/src/boxfunc2.c:1882:9: danger: use of uninitialized value ‘maxindex’ here
# 1880|   
# 1881|       if (maxovlp + delta >= 0)
# 1882|->         *pindex = maxindex;
# 1883|       else
# 1884|           *pindex = n;

Error: COMPILER_WARNING (CWE-457): [#def229]
leptonica-1.87.0/src/boxfunc2.c: scope_hint: In function ‘boxaaAlignBox’
leptonica-1.87.0/src/boxfunc2.c:1882:17: warning[-Wmaybe-uninitialized]: ‘maxindex’ may be used uninitialized
# 1882 |         *pindex = maxindex;
#      |         ~~~~~~~~^~~~~~~~~~
leptonica-1.87.0/src/boxfunc2.c:1843:48: note: ‘maxindex’ was declared here
# 1843 | l_int32  i, n, m, y, yt, h, ht, ovlp, maxovlp, maxindex;
#      |                                                ^~~~~~~~
# 1880|   
# 1881|       if (maxovlp + delta >= 0)
# 1882|->         *pindex = maxindex;
# 1883|       else
# 1884|           *pindex = n;

Error: CPPCHECK_WARNING (CWE-457): [#def230]
leptonica-1.87.0/src/boxfunc5.c:649: warning[uninitvar]: Uninitialized variable: fvarm
#  647|   
#  648|           /* Make decision */
#  649|->     if (fvarp < threshp && fvarm < threshm)
#  650|           *psame = 1;
#  651|       else if (fvarp < threshp && fvarm > threshm)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def231]
leptonica-1.87.0/src/boxfunc5.c:1525:15: warning[-Wanalyzer-malloc-leak]: leak of ‘indic’
leptonica-1.87.0/src/boxfunc5.c:1515:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1516:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1516:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1522:29: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1522:29: acquire_memory: allocated here
leptonica-1.87.0/src/boxfunc5.c:1522:8: branch_false: following ‘false’ branch (when ‘indic’ is non-NULL)...
leptonica-1.87.0/src/boxfunc5.c:1522:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1524:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/boxfunc5.c:1525:15: branch_true: ...to here
leptonica-1.87.0/src/boxfunc5.c:1525:15: throw: if ‘boxaGetValidBox’ throws an exception...
leptonica-1.87.0/src/boxfunc5.c:1525:15: danger: ‘indic’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 1523|           return ERROR_INT("indic not made", __func__, 1);
# 1524|       for (i = 0; i < n; i++) {
# 1525|->         box = boxaGetValidBox(boxa, i, L_CLONE);
# 1526|           if (box)
# 1527|               indic[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def232]
leptonica-1.87.0/src/boxfunc5.c:1528:9: warning[-Wanalyzer-malloc-leak]: leak of ‘indic’
leptonica-1.87.0/src/boxfunc5.c:1515:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1516:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1516:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1522:29: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1522:29: acquire_memory: allocated here
leptonica-1.87.0/src/boxfunc5.c:1522:8: branch_false: following ‘false’ branch (when ‘indic’ is non-NULL)...
leptonica-1.87.0/src/boxfunc5.c:1522:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1524:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/boxfunc5.c:1525:15: branch_true: ...to here
leptonica-1.87.0/src/boxfunc5.c:1526:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1528:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1528:9: throw: if ‘boxDestroy’ throws an exception...
leptonica-1.87.0/src/boxfunc5.c:1528:9: danger: ‘indic’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 1526|           if (box)
# 1527|               indic[i] = 1;
# 1528|->         boxDestroy(&box);
# 1529|       }
# 1530|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def233]
leptonica-1.87.0/src/boxfunc5.c:1533:15: warning[-Wanalyzer-malloc-leak]: leak of ‘indic’
leptonica-1.87.0/src/boxfunc5.c:1515:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1516:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1516:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1522:29: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1522:29: acquire_memory: allocated here
leptonica-1.87.0/src/boxfunc5.c:1522:8: branch_false: following ‘false’ branch (when ‘indic’ is non-NULL)...
leptonica-1.87.0/src/boxfunc5.c:1522:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1526:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1528:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1524:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1524:17: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1532:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/boxfunc5.c:1533:15: branch_true: ...to here
leptonica-1.87.0/src/boxfunc5.c:1533:15: throw: if ‘boxaGetValidBox’ throws an exception...
leptonica-1.87.0/src/boxfunc5.c:1533:15: danger: ‘indic’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 1531|           /* Replace invalid boxes with the nearest valid one */
# 1532|       for (i = 0; i < n; i++) {
# 1533|->         box = boxaGetValidBox(boxa, i, L_CLONE);
# 1534|           if (!box) {
# 1535|               spandown = spanup = 10000000;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def234]
leptonica-1.87.0/src/boxfunc5.c:1551:24: warning[-Wanalyzer-malloc-leak]: leak of ‘indic’
leptonica-1.87.0/src/boxfunc5.c:1515:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1516:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1516:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1522:29: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1522:29: acquire_memory: allocated here
leptonica-1.87.0/src/boxfunc5.c:1522:8: branch_false: following ‘false’ branch (when ‘indic’ is non-NULL)...
leptonica-1.87.0/src/boxfunc5.c:1522:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1526:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1528:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1524:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1524:17: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1532:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/boxfunc5.c:1533:15: branch_true: ...to here
leptonica-1.87.0/src/boxfunc5.c:1536:29: branch_false: following ‘false’ branch (when ‘j == -1’)...
leptonica-1.87.0/src/boxfunc5.c:1542:18: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1551:24: throw: if ‘boxaGetBox’ throws an exception...
leptonica-1.87.0/src/boxfunc5.c:1551:24: danger: ‘indic’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
# 1549|                   boxt = boxaGetBox(boxa, i - spandown, L_COPY);
# 1550|               else
# 1551|->                 boxt = boxaGetBox(boxa, i + spanup, L_COPY);
# 1552|               boxaReplaceBox(boxa, i, boxt);
# 1553|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def235]
leptonica-1.87.0/src/boxfunc5.c:1554:9: warning[-Wanalyzer-malloc-leak]: leak of ‘indic’
leptonica-1.87.0/src/boxfunc5.c:1515:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1516:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1516:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1522:29: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1522:29: acquire_memory: allocated here
leptonica-1.87.0/src/boxfunc5.c:1522:8: branch_false: following ‘false’ branch (when ‘indic’ is non-NULL)...
leptonica-1.87.0/src/boxfunc5.c:1522:8: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1526:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1528:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1524:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1524:17: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1532:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/boxfunc5.c:1533:15: branch_true: ...to here
leptonica-1.87.0/src/boxfunc5.c:1534:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/boxfunc5.c:1554:9: branch_false: ...to here
leptonica-1.87.0/src/boxfunc5.c:1554:9: throw: if ‘boxDestroy’ throws an exception...
leptonica-1.87.0/src/boxfunc5.c:1554:9: danger: ‘indic’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 1552|               boxaReplaceBox(boxa, i, boxt);
# 1553|           }
# 1554|->         boxDestroy(&box);
# 1555|       }
# 1556|   

Error: CPPCHECK_WARNING (CWE-476): [#def236]
leptonica-1.87.0/src/bytearray.c:105: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ba
#  103|           nbytes = InitialArraySize;
#  104|       ba = (L_BYTEA *)LEPT_CALLOC(1, sizeof(L_BYTEA));
#  105|->     ba->data = (l_uint8 *)LEPT_CALLOC(nbytes + 1, sizeof(l_uint8));
#  106|       if (!ba->data) {
#  107|           l_byteaDestroy(&ba);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def237]
leptonica-1.87.0/src/bytearray.c:105:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ba’
leptonica-1.87.0/src/bytearray.c:104:21: acquire_memory: this call could return NULL
leptonica-1.87.0/src/bytearray.c:105:5: danger: ‘calloc(1, 32)’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  103|           nbytes = InitialArraySize;
#  104|       ba = (L_BYTEA *)LEPT_CALLOC(1, sizeof(L_BYTEA));
#  105|->     ba->data = (l_uint8 *)LEPT_CALLOC(nbytes + 1, sizeof(l_uint8));
#  106|       if (!ba->data) {
#  107|           l_byteaDestroy(&ba);

Error: CPPCHECK_WARNING (CWE-476): [#def238]
leptonica-1.87.0/src/bytearray.c:106: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ba
#  104|       ba = (L_BYTEA *)LEPT_CALLOC(1, sizeof(L_BYTEA));
#  105|       ba->data = (l_uint8 *)LEPT_CALLOC(nbytes + 1, sizeof(l_uint8));
#  106|->     if (!ba->data) {
#  107|           l_byteaDestroy(&ba);
#  108|           return (L_BYTEA *)ERROR_PTR("ba array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def239]
leptonica-1.87.0/src/bytearray.c:260:1: warning[-Wanalyzer-malloc-leak]: leak of ‘ba’
leptonica-1.87.0/src/bytearray.c:98:1: enter_function: entry to ‘l_byteaCreate’
leptonica-1.87.0/src/bytearray.c:104:21: acquire_memory: allocated here
leptonica-1.87.0/src/bytearray.c:106:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/bytearray.c:107:9: branch_true: ...to here
leptonica-1.87.0/src/bytearray.c:107:9: call_function: calling ‘l_byteaDestroy’ from ‘l_byteaCreate’
#  258|       }
#  259|       *pba = NULL;
#  260|-> }
#  261|   
#  262|   

Error: CPPCHECK_WARNING (CWE-476): [#def240]
leptonica-1.87.0/src/ccbord.c:333: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ccba
#  331|           ccba->h = pixGetHeight(pixs);
#  332|       }
#  333|->     ccba->n = 0;
#  334|       ccba->nalloc = n;
#  335|       if ((ccba->ccb = (CCBORD **)LEPT_CALLOC(n, sizeof(CCBORD *))) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def241]
leptonica-1.87.0/src/ccbord.c:333:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ccba’
leptonica-1.87.0/src/ccbord.c:2379:1: enter_function: entry to ‘ccbaReadStream’
leptonica-1.87.0/src/ccbord.c:2402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2404:15: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2406:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2410:5: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2412:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2416:5: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2418:17: call_function: calling ‘ccbaCreate’ from ‘ccbaReadStream’
#  331|           ccba->h = pixGetHeight(pixs);
#  332|       }
#  333|->     ccba->n = 0;
#  334|       ccba->nalloc = n;
#  335|       if ((ccba->ccb = (CCBORD **)LEPT_CALLOC(n, sizeof(CCBORD *))) == NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def242]
leptonica-1.87.0/src/ccbord.c:334: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ccba
#  332|       }
#  333|       ccba->n = 0;
#  334|->     ccba->nalloc = n;
#  335|       if ((ccba->ccb = (CCBORD **)LEPT_CALLOC(n, sizeof(CCBORD *))) == NULL) {
#  336|           ccbaDestroy(&ccba);

Error: CPPCHECK_WARNING (CWE-476): [#def243]
leptonica-1.87.0/src/ccbord.c:335: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ccba
#  333|       ccba->n = 0;
#  334|       ccba->nalloc = n;
#  335|->     if ((ccba->ccb = (CCBORD **)LEPT_CALLOC(n, sizeof(CCBORD *))) == NULL) {
#  336|           ccbaDestroy(&ccba);
#  337|           return (CCBORDA *)ERROR_PTR("ccba ptrs not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def244]
leptonica-1.87.0/src/ccbord.c:363:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ccba’
leptonica-1.87.0/src/ccbord.c:2379:1: enter_function: entry to ‘ccbaReadStream’
leptonica-1.87.0/src/ccbord.c:2402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2404:15: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2406:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2410:5: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2412:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2416:5: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2418:17: call_function: calling ‘ccbaCreate’ from ‘ccbaReadStream’
#  361|           return;
#  362|   
#  363|->     pixDestroy(&ccba->pix);
#  364|       for (i = 0; i < ccba->n; i++)
#  365|           ccbDestroy(&ccba->ccb[i]);

Error: CPPCHECK_WARNING (CWE-476): [#def245]
leptonica-1.87.0/src/ccbord.c:390: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ccb
#  388|   
#  389|       ccb = (CCBORD *)LEPT_CALLOC(1, sizeof(CCBORD));
#  390|->     ccb->refcount = 1;
#  391|       if (pixs)
#  392|           ccb->pix = pixClone(pixs);

Error: CPPCHECK_WARNING (CWE-476): [#def246]
leptonica-1.87.0/src/ccbord.c:392: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ccb
#  390|       ccb->refcount = 1;
#  391|       if (pixs)
#  392|->         ccb->pix = pixClone(pixs);
#  393|       boxa = boxaCreate(1);
#  394|       ccb->boxa = boxa;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def247]
leptonica-1.87.0/src/ccbord.c:392:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ccb’
leptonica-1.87.0/src/ccbord.c:389:21: acquire_memory: this call could return NULL
leptonica-1.87.0/src/ccbord.c:391:8: branch_true: following ‘true’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:392:20: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:392:9: danger: ‘ccb’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  390|       ccb->refcount = 1;
#  391|       if (pixs)
#  392|->         ccb->pix = pixClone(pixs);
#  393|       boxa = boxaCreate(1);
#  394|       ccb->boxa = boxa;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def248]
leptonica-1.87.0/src/ccbord.c:392:20: warning[-Wanalyzer-malloc-leak]: leak of ‘ccb’
leptonica-1.87.0/src/ccbord.c:389:21: acquire_memory: allocated here
leptonica-1.87.0/src/ccbord.c:391:8: branch_true: following ‘true’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:392:20: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:392:20: throw: if ‘pixClone’ throws an exception...
leptonica-1.87.0/src/ccbord.c:392:20: danger: ‘ccb’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  390|       ccb->refcount = 1;
#  391|       if (pixs)
#  392|->         ccb->pix = pixClone(pixs);
#  393|       boxa = boxaCreate(1);
#  394|       ccb->boxa = boxa;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def249]
leptonica-1.87.0/src/ccbord.c:393:12: warning[-Wanalyzer-malloc-leak]: leak of ‘ccb’
leptonica-1.87.0/src/ccbord.c:389:21: acquire_memory: allocated here
leptonica-1.87.0/src/ccbord.c:391:8: branch_false: following ‘false’ branch (when ‘pixs’ is NULL)...
leptonica-1.87.0/src/ccbord.c:393:12: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:393:12: throw: if ‘boxaCreate’ throws an exception...
leptonica-1.87.0/src/ccbord.c:393:12: danger: ‘ccb’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  391|       if (pixs)
#  392|           ccb->pix = pixClone(pixs);
#  393|->     boxa = boxaCreate(1);
#  394|       ccb->boxa = boxa;
#  395|       start = ptaCreate(1);

Error: CPPCHECK_WARNING (CWE-476): [#def250]
leptonica-1.87.0/src/ccbord.c:394: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ccb
#  392|           ccb->pix = pixClone(pixs);
#  393|       boxa = boxaCreate(1);
#  394|->     ccb->boxa = boxa;
#  395|       start = ptaCreate(1);
#  396|       ccb->start = start;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def251]
leptonica-1.87.0/src/ccbord.c:394:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ccb’
leptonica-1.87.0/src/ccbord.c:389:21: acquire_memory: this call could return NULL
leptonica-1.87.0/src/ccbord.c:391:8: branch_false: following ‘false’ branch (when ‘pixs’ is NULL)...
leptonica-1.87.0/src/ccbord.c:393:12: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:394:5: danger: ‘ccb’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  392|           ccb->pix = pixClone(pixs);
#  393|       boxa = boxaCreate(1);
#  394|->     ccb->boxa = boxa;
#  395|       start = ptaCreate(1);
#  396|       ccb->start = start;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def252]
leptonica-1.87.0/src/ccbord.c:395:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ccb’
leptonica-1.87.0/src/ccbord.c:389:21: acquire_memory: allocated here
leptonica-1.87.0/src/ccbord.c:391:8: branch_false: following ‘false’ branch (when ‘pixs’ is NULL)...
leptonica-1.87.0/src/ccbord.c:393:12: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:395:13: throw: if ‘ptaCreate’ throws an exception...
leptonica-1.87.0/src/ccbord.c:395:13: danger: ‘ccb’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  393|       boxa = boxaCreate(1);
#  394|       ccb->boxa = boxa;
#  395|->     start = ptaCreate(1);
#  396|       ccb->start = start;
#  397|       local = ptaaCreate(1);

Error: CPPCHECK_WARNING (CWE-476): [#def253]
leptonica-1.87.0/src/ccbord.c:396: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ccb
#  394|       ccb->boxa = boxa;
#  395|       start = ptaCreate(1);
#  396|->     ccb->start = start;
#  397|       local = ptaaCreate(1);
#  398|       ccb->local = local;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def254]
leptonica-1.87.0/src/ccbord.c:397:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ccb’
leptonica-1.87.0/src/ccbord.c:389:21: acquire_memory: allocated here
leptonica-1.87.0/src/ccbord.c:391:8: branch_false: following ‘false’ branch (when ‘pixs’ is NULL)...
leptonica-1.87.0/src/ccbord.c:393:12: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:397:13: throw: if ‘ptaaCreate’ throws an exception...
leptonica-1.87.0/src/ccbord.c:397:13: danger: ‘ccb’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  395|       start = ptaCreate(1);
#  396|       ccb->start = start;
#  397|->     local = ptaaCreate(1);
#  398|       ccb->local = local;
#  399|       return ccb;

Error: CPPCHECK_WARNING (CWE-476): [#def255]
leptonica-1.87.0/src/ccbord.c:398: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ccb
#  396|       ccb->start = start;
#  397|       local = ptaaCreate(1);
#  398|->     ccb->local = local;
#  399|       return ccb;
#  400|   }

Error: COMPILER_WARNING (CWE-457): [#def256]
leptonica-1.87.0/src/ccbord.c:720:16: warning[-Wmaybe-uninitialized]: ‘xh’ may be used uninitialized
#  720 |         for (x = xh + boxt->x; x < w; x++) {  /* look for (fg) border pixel */
#      |              ~~^~~~~~~~~~~~~~
leptonica-1.87.0/src/ccbord.c: scope_hint: In function ‘pixGetAllCCBorders’
leptonica-1.87.0/src/ccbord.c:647:26: note: ‘xh’ was declared here
#  647 | l_int32   allzero, i, x, xh, w, nh;
#      |                          ^~
#  718|               continue;
#  719|           }
#  720|->         for (x = xh + boxt->x; x < w; x++) {  /* look for (fg) border pixel */
#  721|               pixGetPixel(pixs, x, ys, &val);
#  722|               if (val == 1) {

Error: COMPILER_WARNING (CWE-457): [#def257]
leptonica-1.87.0/src/ccbord.c:1007:9: warning[-Wmaybe-uninitialized]: ‘xs’ may be used uninitialized
# 1007 |     if (findNextBorderPixel(w, h, data, wpl, xs, ys, &qpos, &npx, &npy))
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/ccbord.c: scope_hint: In function ‘pixGetAllCCBorders’
leptonica-1.87.0/src/ccbord.c:648:11: note: ‘xs’ was declared here
#  648 | l_int32   xs, ys;   /* starting hole border pixel, relative in pixs */
#      |           ^~
# 1005|           /* Get the second point; there should always be at least 4 pts
# 1006|            * in a minimal hole border!  */
# 1007|->     if (findNextBorderPixel(w, h, data, wpl, xs, ys, &qpos, &npx, &npy))
# 1008|           return ERROR_INT("isolated hole border point!", __func__, 1);
# 1009|   

Error: COMPILER_WARNING (CWE-457): [#def258]
leptonica-1.87.0/src/ccbord.c:1110:8: warning[-Wmaybe-uninitialized]: ‘fpx’ may be used uninitialized
# 1110 |     dx = spx - fpx;
#      |     ~~~^~~~~~~~~~~
leptonica-1.87.0/src/ccbord.c: scope_hint: In function ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1962:10: note: ‘fpx’ was declared here
# 1962 | l_int32  fpx, fpy, spx, spy, xs, ys;
#      |          ^~~
# 1108|   l_int32  dx, dy;
# 1109|   
# 1110|->     dx = spx - fpx;
# 1111|       dy = spy - fpy;
# 1112|   

Error: COMPILER_WARNING (CWE-457): [#def259]
leptonica-1.87.0/src/ccbord.c:1110:8: warning[-Wmaybe-uninitialized]: ‘spx’ may be used uninitialized
# 1110 |     dx = spx - fpx;
#      |     ~~~^~~~~~~~~~~
leptonica-1.87.0/src/ccbord.c: scope_hint: In function ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1962:20: note: ‘spx’ was declared here
# 1962 | l_int32  fpx, fpy, spx, spy, xs, ys;
#      |                    ^~~
# 1108|   l_int32  dx, dy;
# 1109|   
# 1110|->     dx = spx - fpx;
# 1111|       dy = spy - fpy;
# 1112|   

Error: COMPILER_WARNING (CWE-457): [#def260]
leptonica-1.87.0/src/ccbord.c:1111:8: warning[-Wmaybe-uninitialized]: ‘fpy’ may be used uninitialized
# 1111 |     dy = spy - fpy;
#      |     ~~~^~~~~~~~~~~
leptonica-1.87.0/src/ccbord.c: scope_hint: In function ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1962:15: note: ‘fpy’ was declared here
# 1962 | l_int32  fpx, fpy, spx, spy, xs, ys;
#      |               ^~~
# 1109|   
# 1110|       dx = spx - fpx;
# 1111|->     dy = spy - fpy;
# 1112|   
# 1113|       if (dx * dy == 1) {

Error: COMPILER_WARNING (CWE-457): [#def261]
leptonica-1.87.0/src/ccbord.c:1111:8: warning[-Wmaybe-uninitialized]: ‘spy’ may be used uninitialized
# 1111 |     dy = spy - fpy;
#      |     ~~~^~~~~~~~~~~
leptonica-1.87.0/src/ccbord.c: scope_hint: In function ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1962:25: note: ‘spy’ was declared here
# 1962 | l_int32  fpx, fpy, spx, spy, xs, ys;
#      |                         ^~~
# 1109|   
# 1110|       dx = spx - fpx;
# 1111|->     dy = spy - fpy;
# 1112|   
# 1113|       if (dx * dy == 1) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def262]
leptonica-1.87.0/src/ccbord.c:1543:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ccb’
leptonica-1.87.0/src/ccbord.c:1520:1: enter_function: entry to ‘ccbaGenerateSinglePath’
leptonica-1.87.0/src/ccbord.c:1536:8: branch_false: following ‘false’ branch (when ‘ccba’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1539:11: call_function: inlined call to ‘ccbaGetCount’ from ‘ccbaGenerateSinglePath’
leptonica-1.87.0/src/ccbord.c:1541:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1542:15: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1542:15: call_function: calling ‘ccbaGetCcb’ from ‘ccbaGenerateSinglePath’
leptonica-1.87.0/src/ccbord.c:1542:15: return_function: returning to ‘ccbaGenerateSinglePath’ from ‘ccbaGetCcb’
leptonica-1.87.0/src/ccbord.c:1543:12: branch_true: following ‘true’ branch (when ‘ptaa’ is NULL)...
leptonica-1.87.0/src/ccbord.c:1544:13: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1541:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1542:15: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1542:15: call_function: calling ‘ccbaGetCcb’ from ‘ccbaGenerateSinglePath’
leptonica-1.87.0/src/ccbord.c:1542:15: return_function: returning to ‘ccbaGenerateSinglePath’ from ‘ccbaGetCcb’
leptonica-1.87.0/src/ccbord.c:1542:9: release_memory: ‘ccb’ is NULL
leptonica-1.87.0/src/ccbord.c:1543:13: danger: dereference of NULL ‘ccbaGetCcb(ccba,  i)’
# 1541|       for (i = 0; i < ncc; i++) {
# 1542|           ccb = ccbaGetCcb(ccba, i);
# 1543|->         if ((ptaa = ccb->local) == NULL) {
# 1544|               L_WARNING("local pixel loc array not found\n", __func__);
# 1545|               continue;

Error: COMPILER_WARNING (CWE-457): [#def263]
leptonica-1.87.0/src/ccbord.c: scope_hint: In function ‘ccbaGenerateSinglePath’
leptonica-1.87.0/src/ccbord.c:1575:16: warning[-Wmaybe-uninitialized]: ‘len’ may be used uninitialized
# 1575 |             if (len == 0) {  /* lost the hole */
#      |                ^
leptonica-1.87.0/src/ccbord.c:1522:45: note: ‘len’ was declared here
# 1522 | l_int32   i, j, k, ncc, nb, ncut, npt, dir, len, state, lostholes;
#      |                                             ^~~
# 1573|                   /* Find a short path and store it */
# 1574|               ptac = getCutPathForHole(ccb->pix, pta, boxinner, &dir, &len);
# 1575|->             if (len == 0) {  /* lost the hole */
# 1576|                   lostholes++;
# 1577|   /*                boxPrintStreamInfo(stderr, boxa->box[0]); */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def264]
leptonica-1.87.0/src/ccbord.c:2043:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘fpx’
leptonica-1.87.0/src/ccbord.c:1959:1: enter_function: entry to ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1970:8: branch_false: following ‘false’ branch (when ‘ccba’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1973:17: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1973:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1975:11: call_function: inlined call to ‘ccbaGetCount’ from ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1976:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1977:15: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1977:15: call_function: calling ‘ccbaGetCcb’ from ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1977:15: return_function: returning to ‘ccbaDisplayImage1’ from ‘ccbaGetCcb’
leptonica-1.87.0/src/ccbord.c:1978:12: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1985:13: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1985:12: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1991:14: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1992:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1993:24: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1993:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1998:16: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1998:16: branch_true: following ‘true’ branch (when ‘j == 0’)...
leptonica-1.87.0/src/ccbord.c:1999:17: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2010:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2015:19: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2034:16: branch_true: following ‘true’ branch (when ‘j == 0’)...
leptonica-1.87.0/src/ccbord.c:2035:29: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2035:20: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2054:13: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1992:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1993:24: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1993:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1998:16: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2010:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2015:19: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2043:17: danger: use of uninitialized value ‘fpx’ here
# 2041|               } else {   /* fill the hole from inside */
# 2042|                       /* get the location of a seed pixel in the hole */
# 2043|->                 locateOutsideSeedPixel(fpx, fpy, spx, spy, &xs, &ys);
# 2044|   
# 2045|                       /* Put seed in hole and fill interior of hole,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def265]
leptonica-1.87.0/src/ccbord.c:2043:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘fpy’
leptonica-1.87.0/src/ccbord.c:1959:1: enter_function: entry to ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1970:8: branch_false: following ‘false’ branch (when ‘ccba’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1973:17: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1973:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1975:11: call_function: inlined call to ‘ccbaGetCount’ from ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1976:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1977:15: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1977:15: call_function: calling ‘ccbaGetCcb’ from ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1977:15: return_function: returning to ‘ccbaDisplayImage1’ from ‘ccbaGetCcb’
leptonica-1.87.0/src/ccbord.c:1978:12: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1985:13: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1985:12: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1991:14: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1992:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1993:24: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1993:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1998:16: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1998:16: branch_true: following ‘true’ branch (when ‘j == 0’)...
leptonica-1.87.0/src/ccbord.c:1999:17: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2010:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2015:19: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2034:16: branch_true: following ‘true’ branch (when ‘j == 0’)...
leptonica-1.87.0/src/ccbord.c:2035:29: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2035:20: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2054:13: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1992:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1993:24: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1993:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1998:16: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2010:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2015:19: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2043:17: danger: use of uninitialized value ‘fpy’ here
# 2041|               } else {   /* fill the hole from inside */
# 2042|                       /* get the location of a seed pixel in the hole */
# 2043|->                 locateOutsideSeedPixel(fpx, fpy, spx, spy, &xs, &ys);
# 2044|   
# 2045|                       /* Put seed in hole and fill interior of hole,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def266]
leptonica-1.87.0/src/ccbord.c:2043:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘spx’
leptonica-1.87.0/src/ccbord.c:1959:1: enter_function: entry to ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1970:8: branch_false: following ‘false’ branch (when ‘ccba’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1973:17: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1973:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1975:11: call_function: inlined call to ‘ccbaGetCount’ from ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1976:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1977:15: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1977:15: call_function: calling ‘ccbaGetCcb’ from ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1977:15: return_function: returning to ‘ccbaDisplayImage1’ from ‘ccbaGetCcb’
leptonica-1.87.0/src/ccbord.c:1978:12: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1985:13: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1985:12: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1991:14: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1992:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1993:24: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1993:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1998:16: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1998:16: branch_true: following ‘true’ branch (when ‘j == 0’)...
leptonica-1.87.0/src/ccbord.c:1999:17: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2010:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2015:19: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2034:16: branch_true: following ‘true’ branch (when ‘j == 0’)...
leptonica-1.87.0/src/ccbord.c:2035:29: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2035:20: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2054:13: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1992:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1993:24: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1993:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1998:16: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2010:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2015:19: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2043:17: danger: use of uninitialized value ‘spx’ here
# 2041|               } else {   /* fill the hole from inside */
# 2042|                       /* get the location of a seed pixel in the hole */
# 2043|->                 locateOutsideSeedPixel(fpx, fpy, spx, spy, &xs, &ys);
# 2044|   
# 2045|                       /* Put seed in hole and fill interior of hole,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def267]
leptonica-1.87.0/src/ccbord.c:2043:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘spy’
leptonica-1.87.0/src/ccbord.c:1959:1: enter_function: entry to ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1970:8: branch_false: following ‘false’ branch (when ‘ccba’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1973:17: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1973:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1975:11: call_function: inlined call to ‘ccbaGetCount’ from ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1976:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1977:15: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1977:15: call_function: calling ‘ccbaGetCcb’ from ‘ccbaDisplayImage1’
leptonica-1.87.0/src/ccbord.c:1977:15: return_function: returning to ‘ccbaDisplayImage1’ from ‘ccbaGetCcb’
leptonica-1.87.0/src/ccbord.c:1978:12: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1985:13: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1985:12: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:1991:14: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1992:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1993:24: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1993:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1998:16: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1998:16: branch_true: following ‘true’ branch (when ‘j == 0’)...
leptonica-1.87.0/src/ccbord.c:1999:17: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2010:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2015:19: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2034:16: branch_true: following ‘true’ branch (when ‘j == 0’)...
leptonica-1.87.0/src/ccbord.c:2035:29: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2035:20: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2054:13: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:1992:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:1993:24: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:1993:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:1998:16: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2010:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2015:19: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2043:17: danger: use of uninitialized value ‘spy’ here
# 2041|               } else {   /* fill the hole from inside */
# 2042|                       /* get the location of a seed pixel in the hole */
# 2043|->                 locateOutsideSeedPixel(fpx, fpy, spx, spy, &xs, &ys);
# 2044|   
# 2045|                       /* Put seed in hole and fill interior of hole,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def268]
leptonica-1.87.0/src/ccbord.c:2270:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ccb’
leptonica-1.87.0/src/ccbord.c:2233:1: enter_function: entry to ‘ccbaWriteStream’
leptonica-1.87.0/src/ccbord.c:2253:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:2255:8: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2255:8: branch_false: following ‘false’ branch (when ‘ccba’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:2258:17: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2258:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2261:11: call_function: inlined call to ‘ccbaGetCount’ from ‘ccbaWriteStream’
leptonica-1.87.0/src/ccbord.c:2268:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:2269:15: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2269:15: call_function: calling ‘ccbaGetCcb’ from ‘ccbaWriteStream’
leptonica-1.87.0/src/ccbord.c:2269:15: return_function: returning to ‘ccbaWriteStream’ from ‘ccbaGetCcb’
leptonica-1.87.0/src/ccbord.c:2269:9: release_memory: ‘ccb’ is NULL
leptonica-1.87.0/src/ccbord.c:2270:32: danger: dereference of NULL ‘ccbaGetCcb(ccba,  i)’
# 2268|       for (i = 0; i < ncc; i++) {
# 2269|           ccb = ccbaGetCcb(ccba, i);
# 2270|->         if (boxaGetBoxGeometry(ccb->boxa, 0, &bx, &by, &bw, &bh)) {
# 2271|               bbufferDestroy(&bbuf);
# 2272|               ccbDestroy(&ccb);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def269]
leptonica-1.87.0/src/ccbord.c:2302:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘bval’
leptonica-1.87.0/src/ccbord.c:2233:1: enter_function: entry to ‘ccbaWriteStream’
leptonica-1.87.0/src/ccbord.c:2253:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:2255:8: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2255:8: branch_false: following ‘false’ branch (when ‘ccba’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:2258:17: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2258:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2261:11: call_function: inlined call to ‘ccbaGetCount’ from ‘ccbaWriteStream’
leptonica-1.87.0/src/ccbord.c:2268:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:2269:15: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2269:15: call_function: calling ‘ccbaGetCcb’ from ‘ccbaWriteStream’
leptonica-1.87.0/src/ccbord.c:2269:15: return_function: returning to ‘ccbaWriteStream’ from ‘ccbaGetCcb’
leptonica-1.87.0/src/ccbord.c:2270:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2275:9: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2279:12: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/ccbord.c:2283:14: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2286:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:2287:13: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2292:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ccbord.c:2301:17: branch_false: ...to here
leptonica-1.87.0/src/ccbord.c:2301:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ccbord.c:2302:17: branch_true: ...to here
leptonica-1.87.0/src/ccbord.c:2302:17: danger: use of uninitialized value ‘bval’ here
# 2300|               }
# 2301|               if (n % 2 == 1) {
# 2302|->                 bval |= 0x8;
# 2303|                   bbufferRead(bbuf, (l_uint8 *)&bval, 1); /* end with 0xz8,   */
# 2304|                                                /* where z = {0..7} */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def270]
leptonica-1.87.0/src/classapp.c:798:15: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:798:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:798:15: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  796|       }
#  797|       for (i = 0; i < n1; i++) {
#  798|->         na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def271]
leptonica-1.87.0/src/classapp.c:798:15: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:798:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:798:15: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  796|       }
#  797|       for (i = 0; i < n1; i++) {
#  798|->         na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def272]
leptonica-1.87.0/src/classapp.c:798:15: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:798:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:798:15: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/12)
#  796|       }
#  797|       for (i = 0; i < n1; i++) {
#  798|->         na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def273]
leptonica-1.87.0/src/classapp.c:798:15: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:787:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:798:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:798:15: danger: ‘xleft2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/12)
#  796|       }
#  797|       for (i = 0; i < n1; i++) {
#  798|->         na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def274]
leptonica-1.87.0/src/classapp.c:798:15: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:798:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:798:15: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  796|       }
#  797|       for (i = 0; i < n1; i++) {
#  798|->         na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def275]
leptonica-1.87.0/src/classapp.c:798:15: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:785:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:798:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:798:15: danger: ‘yloc2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12)
#  796|       }
#  797|       for (i = 0; i < n1; i++) {
#  798|->         na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def276]
leptonica-1.87.0/src/classapp.c:799:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:799:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:799:9: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
#  797|       for (i = 0; i < n1; i++) {
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|->         numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def277]
leptonica-1.87.0/src/classapp.c:799:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:799:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:799:9: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
#  797|       for (i = 0; i < n1; i++) {
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|->         numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def278]
leptonica-1.87.0/src/classapp.c:799:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:799:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:799:9: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/12)
#  797|       for (i = 0; i < n1; i++) {
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|->         numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def279]
leptonica-1.87.0/src/classapp.c:799:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:787:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:799:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:799:9: danger: ‘xleft2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/12)
#  797|       for (i = 0; i < n1; i++) {
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|->         numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def280]
leptonica-1.87.0/src/classapp.c:799:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:799:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:799:9: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/12)
#  797|       for (i = 0; i < n1; i++) {
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|->         numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def281]
leptonica-1.87.0/src/classapp.c:799:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:785:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:799:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:799:9: danger: ‘yloc2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/12)
#  797|       for (i = 0; i < n1; i++) {
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|->         numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def282]
leptonica-1.87.0/src/classapp.c:800:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:800:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:800:9: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/12)
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|->         numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;
#  802|           if (nbox >= nperline)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def283]
leptonica-1.87.0/src/classapp.c:800:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:800:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:800:9: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/12)
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|->         numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;
#  802|           if (nbox >= nperline)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def284]
leptonica-1.87.0/src/classapp.c:800:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:800:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:800:9: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/12)
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|->         numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;
#  802|           if (nbox >= nperline)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def285]
leptonica-1.87.0/src/classapp.c:800:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:787:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:800:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:800:9: danger: ‘xleft2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/12)
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|->         numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;
#  802|           if (nbox >= nperline)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def286]
leptonica-1.87.0/src/classapp.c:800:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:785:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:800:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:800:9: danger: ‘yloc2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/12)
#  798|           na1 = numaaGetNuma(naa1, i, L_CLONE);
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|->         numaGetIValue(na1, 1, xleft1 + i);
#  801|           nbox = (numaGetCount(na1) - 1) / 2;
#  802|           if (nbox >= nperline)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def287]
leptonica-1.87.0/src/classapp.c:801:17: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:801:17: throw: if ‘numaGetCount’ throws an exception...
leptonica-1.87.0/src/classapp.c:801:17: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/12)
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);
#  801|->         nbox = (numaGetCount(na1) - 1) / 2;
#  802|           if (nbox >= nperline)
#  803|               line1[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def288]
leptonica-1.87.0/src/classapp.c:801:17: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:801:17: throw: if ‘numaGetCount’ throws an exception...
leptonica-1.87.0/src/classapp.c:801:17: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/12)
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);
#  801|->         nbox = (numaGetCount(na1) - 1) / 2;
#  802|           if (nbox >= nperline)
#  803|               line1[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def289]
leptonica-1.87.0/src/classapp.c:801:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:787:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:801:17: throw: if ‘numaGetCount’ throws an exception...
leptonica-1.87.0/src/classapp.c:801:17: danger: ‘xleft2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/12)
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);
#  801|->         nbox = (numaGetCount(na1) - 1) / 2;
#  802|           if (nbox >= nperline)
#  803|               line1[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def290]
leptonica-1.87.0/src/classapp.c:801:17: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:785:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:801:17: throw: if ‘numaGetCount’ throws an exception...
leptonica-1.87.0/src/classapp.c:801:17: danger: ‘yloc2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/12)
#  799|           numaGetIValue(na1, 0, yloc1 + i);
#  800|           numaGetIValue(na1, 1, xleft1 + i);
#  801|->         nbox = (numaGetCount(na1) - 1) / 2;
#  802|           if (nbox >= nperline)
#  803|               line1[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def291]
leptonica-1.87.0/src/classapp.c:804:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:802:12: branch_false: following ‘false’ branch (when ‘nperline > nbox’)...
leptonica-1.87.0/src/classapp.c:804:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:804:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/classapp.c:804:9: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/12)
#  802|           if (nbox >= nperline)
#  803|               line1[i] = 1;
#  804|->         numaDestroy(&na1);
#  805|       }
#  806|       for (i = 0; i < n2; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def292]
leptonica-1.87.0/src/classapp.c:804:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:802:12: branch_false: following ‘false’ branch (when ‘nperline > nbox’)...
leptonica-1.87.0/src/classapp.c:804:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:804:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/classapp.c:804:9: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/12)
#  802|           if (nbox >= nperline)
#  803|               line1[i] = 1;
#  804|->         numaDestroy(&na1);
#  805|       }
#  806|       for (i = 0; i < n2; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def293]
leptonica-1.87.0/src/classapp.c:804:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:787:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:802:12: branch_false: following ‘false’ branch (when ‘nperline > nbox’)...
leptonica-1.87.0/src/classapp.c:804:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:804:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/classapp.c:804:9: danger: ‘xleft2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/12)
#  802|           if (nbox >= nperline)
#  803|               line1[i] = 1;
#  804|->         numaDestroy(&na1);
#  805|       }
#  806|       for (i = 0; i < n2; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def294]
leptonica-1.87.0/src/classapp.c:804:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:785:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:802:12: branch_false: following ‘false’ branch (when ‘nperline > nbox’)...
leptonica-1.87.0/src/classapp.c:804:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:804:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/classapp.c:804:9: danger: ‘yloc2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/12)
#  802|           if (nbox >= nperline)
#  803|               line1[i] = 1;
#  804|->         numaDestroy(&na1);
#  805|       }
#  806|       for (i = 0; i < n2; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def295]
leptonica-1.87.0/src/classapp.c:807:15: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:807:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:807:15: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/12)
#  805|       }
#  806|       for (i = 0; i < n2; i++) {
#  807|->         na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def296]
leptonica-1.87.0/src/classapp.c:807:15: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:807:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:807:15: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/12)
#  805|       }
#  806|       for (i = 0; i < n2; i++) {
#  807|->         na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def297]
leptonica-1.87.0/src/classapp.c:807:15: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:807:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:807:15: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/12)
#  805|       }
#  806|       for (i = 0; i < n2; i++) {
#  807|->         na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def298]
leptonica-1.87.0/src/classapp.c:807:15: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:787:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:807:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:807:15: danger: ‘xleft2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/12)
#  805|       }
#  806|       for (i = 0; i < n2; i++) {
#  807|->         na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def299]
leptonica-1.87.0/src/classapp.c:807:15: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:807:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:807:15: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/12)
#  805|       }
#  806|       for (i = 0; i < n2; i++) {
#  807|->         na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def300]
leptonica-1.87.0/src/classapp.c:807:15: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:785:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:807:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:807:15: danger: ‘yloc2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/12)
#  805|       }
#  806|       for (i = 0; i < n2; i++) {
#  807|->         na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def301]
leptonica-1.87.0/src/classapp.c:808:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:808:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:808:9: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/12)
#  806|       for (i = 0; i < n2; i++) {
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|->         numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def302]
leptonica-1.87.0/src/classapp.c:808:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:808:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:808:9: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/12)
#  806|       for (i = 0; i < n2; i++) {
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|->         numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def303]
leptonica-1.87.0/src/classapp.c:808:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:808:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:808:9: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/12)
#  806|       for (i = 0; i < n2; i++) {
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|->         numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def304]
leptonica-1.87.0/src/classapp.c:808:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:787:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:808:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:808:9: danger: ‘xleft2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/12)
#  806|       for (i = 0; i < n2; i++) {
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|->         numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def305]
leptonica-1.87.0/src/classapp.c:808:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:808:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:808:9: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/12)
#  806|       for (i = 0; i < n2; i++) {
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|->         numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def306]
leptonica-1.87.0/src/classapp.c:808:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:785:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:808:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:808:9: danger: ‘yloc2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/12)
#  806|       for (i = 0; i < n2; i++) {
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|->         numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def307]
leptonica-1.87.0/src/classapp.c:809:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:809:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:809:9: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/12)
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|->         numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;
#  811|           if (nbox >= nperline)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def308]
leptonica-1.87.0/src/classapp.c:809:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:809:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:809:9: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/12)
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|->         numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;
#  811|           if (nbox >= nperline)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def309]
leptonica-1.87.0/src/classapp.c:809:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:809:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:809:9: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/12)
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|->         numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;
#  811|           if (nbox >= nperline)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def310]
leptonica-1.87.0/src/classapp.c:809:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:787:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:809:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:809:9: danger: ‘xleft2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/12)
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|->         numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;
#  811|           if (nbox >= nperline)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def311]
leptonica-1.87.0/src/classapp.c:809:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:809:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/classapp.c:809:9: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/12)
#  807|           na2 = numaaGetNuma(naa2, i, L_CLONE);
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|->         numaGetIValue(na2, 1, xleft2 + i);
#  810|           nbox = (numaGetCount(na2) - 1) / 2;
#  811|           if (nbox >= nperline)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def312]
leptonica-1.87.0/src/classapp.c:810:17: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:810:17: throw: if ‘numaGetCount’ throws an exception...
leptonica-1.87.0/src/classapp.c:810:17: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/12)
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);
#  810|->         nbox = (numaGetCount(na2) - 1) / 2;
#  811|           if (nbox >= nperline)
#  812|               line2[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def313]
leptonica-1.87.0/src/classapp.c:810:17: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:810:17: throw: if ‘numaGetCount’ throws an exception...
leptonica-1.87.0/src/classapp.c:810:17: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/12)
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);
#  810|->         nbox = (numaGetCount(na2) - 1) / 2;
#  811|           if (nbox >= nperline)
#  812|               line2[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def314]
leptonica-1.87.0/src/classapp.c:810:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:810:17: throw: if ‘numaGetCount’ throws an exception...
leptonica-1.87.0/src/classapp.c:810:17: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/12)
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);
#  810|->         nbox = (numaGetCount(na2) - 1) / 2;
#  811|           if (nbox >= nperline)
#  812|               line2[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def315]
leptonica-1.87.0/src/classapp.c:810:17: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:810:17: throw: if ‘numaGetCount’ throws an exception...
leptonica-1.87.0/src/classapp.c:810:17: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/12)
#  808|           numaGetIValue(na2, 0, yloc2 + i);
#  809|           numaGetIValue(na2, 1, xleft2 + i);
#  810|->         nbox = (numaGetCount(na2) - 1) / 2;
#  811|           if (nbox >= nperline)
#  812|               line2[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def316]
leptonica-1.87.0/src/classapp.c:813:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:813:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/classapp.c:813:9: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/12)
#  811|           if (nbox >= nperline)
#  812|               line2[i] = 1;
#  813|->         numaDestroy(&na2);
#  814|       }
#  815|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def317]
leptonica-1.87.0/src/classapp.c:813:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:813:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/classapp.c:813:9: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/12)
#  811|           if (nbox >= nperline)
#  812|               line2[i] = 1;
#  813|->         numaDestroy(&na2);
#  814|       }
#  815|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def318]
leptonica-1.87.0/src/classapp.c:813:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:813:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/classapp.c:813:9: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/12)
#  811|           if (nbox >= nperline)
#  812|               line2[i] = 1;
#  813|->         numaDestroy(&na2);
#  814|       }
#  815|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def319]
leptonica-1.87.0/src/classapp.c:813:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:813:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/classapp.c:813:9: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/12)
#  811|           if (nbox >= nperline)
#  812|               line2[i] = 1;
#  813|->         numaDestroy(&na2);
#  814|       }
#  815|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def320]
leptonica-1.87.0/src/classapp.c:823:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:823:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:823:12: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/12)
#  821|            * The result is a set of four numas giving parameters of
#  822|            * each set of matching lines. */
#  823|->     nai1 = numaCreate(0);  /* line index 1 of match */
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def321]
leptonica-1.87.0/src/classapp.c:823:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:823:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:823:12: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/12)
#  821|            * The result is a set of four numas giving parameters of
#  822|            * each set of matching lines. */
#  823|->     nai1 = numaCreate(0);  /* line index 1 of match */
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def322]
leptonica-1.87.0/src/classapp.c:823:12: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:823:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:823:12: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/12)
#  821|            * The result is a set of four numas giving parameters of
#  822|            * each set of matching lines. */
#  823|->     nai1 = numaCreate(0);  /* line index 1 of match */
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def323]
leptonica-1.87.0/src/classapp.c:823:12: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:823:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:823:12: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/12)
#  821|            * The result is a set of four numas giving parameters of
#  822|            * each set of matching lines. */
#  823|->     nai1 = numaCreate(0);  /* line index 1 of match */
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def324]
leptonica-1.87.0/src/classapp.c:824:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:824:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:824:12: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/12)
#  822|            * each set of matching lines. */
#  823|       nai1 = numaCreate(0);  /* line index 1 of match */
#  824|->     nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */
#  826|       nasy = numaCreate(0);  /* shifty for match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def325]
leptonica-1.87.0/src/classapp.c:824:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:824:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:824:12: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/12)
#  822|            * each set of matching lines. */
#  823|       nai1 = numaCreate(0);  /* line index 1 of match */
#  824|->     nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */
#  826|       nasy = numaCreate(0);  /* shifty for match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def326]
leptonica-1.87.0/src/classapp.c:824:12: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:824:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:824:12: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/12)
#  822|            * each set of matching lines. */
#  823|       nai1 = numaCreate(0);  /* line index 1 of match */
#  824|->     nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */
#  826|       nasy = numaCreate(0);  /* shifty for match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def327]
leptonica-1.87.0/src/classapp.c:824:12: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:824:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:824:12: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/12)
#  822|            * each set of matching lines. */
#  823|       nai1 = numaCreate(0);  /* line index 1 of match */
#  824|->     nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */
#  826|       nasy = numaCreate(0);  /* shifty for match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def328]
leptonica-1.87.0/src/classapp.c:825:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:825:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:825:12: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/12)
#  823|       nai1 = numaCreate(0);  /* line index 1 of match */
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|->     nasx = numaCreate(0);  /* shiftx for match */
#  826|       nasy = numaCreate(0);  /* shifty for match */
#  827|       for (i = 0; i < n1; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def329]
leptonica-1.87.0/src/classapp.c:825:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:825:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:825:12: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/12)
#  823|       nai1 = numaCreate(0);  /* line index 1 of match */
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|->     nasx = numaCreate(0);  /* shiftx for match */
#  826|       nasy = numaCreate(0);  /* shifty for match */
#  827|       for (i = 0; i < n1; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def330]
leptonica-1.87.0/src/classapp.c:825:12: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:825:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:825:12: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/12)
#  823|       nai1 = numaCreate(0);  /* line index 1 of match */
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|->     nasx = numaCreate(0);  /* shiftx for match */
#  826|       nasy = numaCreate(0);  /* shifty for match */
#  827|       for (i = 0; i < n1; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def331]
leptonica-1.87.0/src/classapp.c:825:12: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:825:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:825:12: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/12)
#  823|       nai1 = numaCreate(0);  /* line index 1 of match */
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|->     nasx = numaCreate(0);  /* shiftx for match */
#  826|       nasy = numaCreate(0);  /* shifty for match */
#  827|       for (i = 0; i < n1; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def332]
leptonica-1.87.0/src/classapp.c:826:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:826:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:826:12: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/64/codeFlows/0/threadFlows/0/locations/12)
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */
#  826|->     nasy = numaCreate(0);  /* shifty for match */
#  827|       for (i = 0; i < n1; i++) {
#  828|           if (line1[i] == 0) continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def333]
leptonica-1.87.0/src/classapp.c:826:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:826:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:826:12: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/65/codeFlows/0/threadFlows/0/locations/12)
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */
#  826|->     nasy = numaCreate(0);  /* shifty for match */
#  827|       for (i = 0; i < n1; i++) {
#  828|           if (line1[i] == 0) continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def334]
leptonica-1.87.0/src/classapp.c:826:12: warning[-Wanalyzer-malloc-leak]: leak of ‘xleft1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:786:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:826:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:826:12: danger: ‘xleft1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/63/codeFlows/0/threadFlows/0/locations/12)
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */
#  826|->     nasy = numaCreate(0);  /* shifty for match */
#  827|       for (i = 0; i < n1; i++) {
#  828|           if (line1[i] == 0) continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def335]
leptonica-1.87.0/src/classapp.c:826:12: warning[-Wanalyzer-malloc-leak]: leak of ‘yloc1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:784:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:788:29: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:826:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/classapp.c:826:12: danger: ‘yloc1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/62/codeFlows/0/threadFlows/0/locations/12)
#  824|       nai2 = numaCreate(0);  /* line index 2 of match */
#  825|       nasx = numaCreate(0);  /* shiftx for match */
#  826|->     nasy = numaCreate(0);  /* shifty for match */
#  827|       for (i = 0; i < n1; i++) {
#  828|           if (line1[i] == 0) continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def336]
leptonica-1.87.0/src/classapp.c:831:15: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:802:12: branch_false: following ‘false’ branch (when ‘nperline > nbox’)...
leptonica-1.87.0/src/classapp.c:804:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:828:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:829:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:831:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:831:15: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/12)
#  829|           y1 = yloc1[i];
#  830|           xl1 = xleft1[i];
#  831|->         na1 = numaaGetNuma(naa1, i, L_CLONE);
#  832|           for (j = 0; j < n2; j++) {
#  833|               if (line2[j] == 0) continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def337]
leptonica-1.87.0/src/classapp.c:831:15: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:802:12: branch_false: following ‘false’ branch (when ‘nperline > nbox’)...
leptonica-1.87.0/src/classapp.c:804:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:828:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:829:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:831:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:831:15: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/67/codeFlows/0/threadFlows/0/locations/12)
#  829|           y1 = yloc1[i];
#  830|           xl1 = xleft1[i];
#  831|->         na1 = numaaGetNuma(naa1, i, L_CLONE);
#  832|           for (j = 0; j < n2; j++) {
#  833|               if (line2[j] == 0) continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def338]
leptonica-1.87.0/src/classapp.c:835:16: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  833|               if (line2[j] == 0) continue;
#  834|               y2 = yloc2[j];
#  835|->             if (L_ABS(y1 - y2) > maxshifty) continue;
#  836|               xl2 = xleft2[j];
#  837|               if (L_ABS(xl1 - xl2) > maxshiftx) continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def339]
leptonica-1.87.0/src/classapp.c:835:16: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  833|               if (line2[j] == 0) continue;
#  834|               y2 = yloc2[j];
#  835|->             if (L_ABS(y1 - y2) > maxshifty) continue;
#  836|               xl2 = xleft2[j];
#  837|               if (L_ABS(xl1 - xl2) > maxshiftx) continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def340]
leptonica-1.87.0/src/classapp.c:840:19: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:802:12: branch_false: following ‘false’ branch (when ‘nperline > nbox’)...
leptonica-1.87.0/src/classapp.c:804:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:840:19: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:840:19: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/70/codeFlows/0/threadFlows/0/locations/12)
#  838|               shiftx = xl1 - xl2;  /* shift to add to x2 values */
#  839|               shifty = y1 - y2;  /* shift to add to y2 values */
#  840|->             na2 = numaaGetNuma(naa2, j, L_CLONE);
#  841|   
#  842|                   /* Now check if 'nperline' boxes in the two lines match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def341]
leptonica-1.87.0/src/classapp.c:840:19: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:802:12: branch_false: following ‘false’ branch (when ‘nperline > nbox’)...
leptonica-1.87.0/src/classapp.c:804:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:840:19: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/classapp.c:840:19: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/71/codeFlows/0/threadFlows/0/locations/12)
#  838|               shiftx = xl1 - xl2;  /* shift to add to x2 values */
#  839|               shifty = y1 - y2;  /* shift to add to y2 values */
#  840|->             na2 = numaaGetNuma(naa2, j, L_CLONE);
#  841|   
#  842|                   /* Now check if 'nperline' boxes in the two lines match */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def342]
leptonica-1.87.0/src/classapp.c:852:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:802:12: branch_false: following ‘false’ branch (when ‘nperline > nbox’)...
leptonica-1.87.0/src/classapp.c:804:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:852:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/classapp.c:852:9: danger: ‘line1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/72/codeFlows/0/threadFlows/0/locations/12)
#  850|               numaDestroy(&na2);
#  851|           }
#  852|->         numaDestroy(&na1);
#  853|       }
#  854|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def343]
leptonica-1.87.0/src/classapp.c:852:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:802:12: branch_false: following ‘false’ branch (when ‘nperline > nbox’)...
leptonica-1.87.0/src/classapp.c:804:9: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:797:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:823:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:852:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/classapp.c:852:9: danger: ‘line2’ leaks here; was allocated at [(13)](sarif:/runs/0/results/73/codeFlows/0/threadFlows/0/locations/12)
#  850|               numaDestroy(&na2);
#  851|           }
#  852|->         numaDestroy(&na1);
#  853|       }
#  854|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def344]
leptonica-1.87.0/src/classapp.c:886:16: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  884|   
#  885|       if (!na1)
#  886|->         return ERROR_INT("na1 not defined", __func__, 1);
#  887|       if (!na2)
#  888|           return ERROR_INT("na2 not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def345]
leptonica-1.87.0/src/classapp.c:886:16: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  884|   
#  885|       if (!na1)
#  886|->         return ERROR_INT("na1 not defined", __func__, 1);
#  887|       if (!na2)
#  888|           return ERROR_INT("na2 not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def346]
leptonica-1.87.0/src/classapp.c:888:16: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  886|           return ERROR_INT("na1 not defined", __func__, 1);
#  887|       if (!na2)
#  888|->         return ERROR_INT("na2 not defined", __func__, 1);
#  889|   
#  890|       for (i = 0; i < nperline; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def347]
leptonica-1.87.0/src/classapp.c:888:16: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  886|           return ERROR_INT("na1 not defined", __func__, 1);
#  887|       if (!na2)
#  888|->         return ERROR_INT("na2 not defined", __func__, 1);
#  889|   
#  890|       for (i = 0; i < nperline; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def348]
leptonica-1.87.0/src/classapp.c:891:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  889|   
#  890|       for (i = 0; i < nperline; i++) {
#  891|->         numaGetIValue(na1, i + 1, &xl1);
#  892|           numaGetIValue(na1, i + 2, &xr1);
#  893|           numaGetIValue(na2, i + 1, &xl2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def349]
leptonica-1.87.0/src/classapp.c:891:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  889|   
#  890|       for (i = 0; i < nperline; i++) {
#  891|->         numaGetIValue(na1, i + 1, &xl1);
#  892|           numaGetIValue(na1, i + 2, &xr1);
#  893|           numaGetIValue(na2, i + 1, &xl2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def350]
leptonica-1.87.0/src/classapp.c:892:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  890|       for (i = 0; i < nperline; i++) {
#  891|           numaGetIValue(na1, i + 1, &xl1);
#  892|->         numaGetIValue(na1, i + 2, &xr1);
#  893|           numaGetIValue(na2, i + 1, &xl2);
#  894|           numaGetIValue(na2, i + 2, &xr2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def351]
leptonica-1.87.0/src/classapp.c:892:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  890|       for (i = 0; i < nperline; i++) {
#  891|           numaGetIValue(na1, i + 1, &xl1);
#  892|->         numaGetIValue(na1, i + 2, &xr1);
#  893|           numaGetIValue(na2, i + 1, &xl2);
#  894|           numaGetIValue(na2, i + 2, &xr2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def352]
leptonica-1.87.0/src/classapp.c:893:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  891|           numaGetIValue(na1, i + 1, &xl1);
#  892|           numaGetIValue(na1, i + 2, &xr1);
#  893|->         numaGetIValue(na2, i + 1, &xl2);
#  894|           numaGetIValue(na2, i + 2, &xr2);
#  895|           diffl = L_ABS(xl1 - xl2 - shiftx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def353]
leptonica-1.87.0/src/classapp.c:893:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  891|           numaGetIValue(na1, i + 1, &xl1);
#  892|           numaGetIValue(na1, i + 2, &xr1);
#  893|->         numaGetIValue(na2, i + 1, &xl2);
#  894|           numaGetIValue(na2, i + 2, &xr2);
#  895|           diffl = L_ABS(xl1 - xl2 - shiftx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def354]
leptonica-1.87.0/src/classapp.c:894:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  892|           numaGetIValue(na1, i + 2, &xr1);
#  893|           numaGetIValue(na2, i + 1, &xl2);
#  894|->         numaGetIValue(na2, i + 2, &xr2);
#  895|           diffl = L_ABS(xl1 - xl2 - shiftx);
#  896|           diffr = L_ABS(xr1 - xr2 - shiftx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def355]
leptonica-1.87.0/src/classapp.c:894:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:835:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:836:25: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:837:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:840:19: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:843:21: call_function: calling ‘testLineAlignmentX’ from ‘numaaCompareImagesByBoxes’
#  892|           numaGetIValue(na1, i + 2, &xr1);
#  893|           numaGetIValue(na2, i + 1, &xl2);
#  894|->         numaGetIValue(na2, i + 2, &xr2);
#  895|           diffl = L_ABS(xl1 - xl2 - shiftx);
#  896|           diffr = L_ABS(xr1 - xr2 - shiftx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def356]
leptonica-1.87.0/src/classapp.c:958:11: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  956|           return 0;
#  957|   
#  958|->     ia1 = numaGetIArray(nai1);
#  959|       ia2 = numaGetIArray(nai2);
#  960|       iasx = numaGetIArray(nasx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def357]
leptonica-1.87.0/src/classapp.c:958:11: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  956|           return 0;
#  957|   
#  958|->     ia1 = numaGetIArray(nai1);
#  959|       ia2 = numaGetIArray(nai2);
#  960|       iasx = numaGetIArray(nasx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def358]
leptonica-1.87.0/src/classapp.c:959:11: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  957|   
#  958|       ia1 = numaGetIArray(nai1);
#  959|->     ia2 = numaGetIArray(nai2);
#  960|       iasx = numaGetIArray(nasx);
#  961|       iasy = numaGetIArray(nasy);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def359]
leptonica-1.87.0/src/classapp.c:959:11: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  957|   
#  958|       ia1 = numaGetIArray(nai1);
#  959|->     ia2 = numaGetIArray(nai2);
#  960|       iasx = numaGetIArray(nasx);
#  961|       iasy = numaGetIArray(nasy);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def360]
leptonica-1.87.0/src/classapp.c:960:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  958|       ia1 = numaGetIArray(nai1);
#  959|       ia2 = numaGetIArray(nai2);
#  960|->     iasx = numaGetIArray(nasx);
#  961|       iasy = numaGetIArray(nasy);
#  962|       index1 = (l_int32 *)LEPT_CALLOC(n1, sizeof(l_int32));  /* watch rows */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def361]
leptonica-1.87.0/src/classapp.c:960:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  958|       ia1 = numaGetIArray(nai1);
#  959|       ia2 = numaGetIArray(nai2);
#  960|->     iasx = numaGetIArray(nasx);
#  961|       iasy = numaGetIArray(nasy);
#  962|       index1 = (l_int32 *)LEPT_CALLOC(n1, sizeof(l_int32));  /* watch rows */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def362]
leptonica-1.87.0/src/classapp.c:961:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  959|       ia2 = numaGetIArray(nai2);
#  960|       iasx = numaGetIArray(nasx);
#  961|->     iasy = numaGetIArray(nasy);
#  962|       index1 = (l_int32 *)LEPT_CALLOC(n1, sizeof(l_int32));  /* watch rows */
#  963|       index2 = (l_int32 *)LEPT_CALLOC(n2, sizeof(l_int32));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def363]
leptonica-1.87.0/src/classapp.c:961:12: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  959|       ia2 = numaGetIArray(nai2);
#  960|       iasx = numaGetIArray(nasx);
#  961|->     iasy = numaGetIArray(nasy);
#  962|       index1 = (l_int32 *)LEPT_CALLOC(n1, sizeof(l_int32));  /* watch rows */
#  963|       index2 = (l_int32 *)LEPT_CALLOC(n2, sizeof(l_int32));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def364]
leptonica-1.87.0/src/classapp.c:965:16: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:962:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:965:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:965:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:965:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:965:16: throw: if ‘returnErrorInt’ throws an exception...
leptonica-1.87.0/src/classapp.c:965:16: danger: ‘index1’ leaks here; was allocated at [(7)](sarif:/runs/0/results/94/codeFlows/0/threadFlows/0/locations/6)
#  963|       index2 = (l_int32 *)LEPT_CALLOC(n2, sizeof(l_int32));
#  964|       if (!index1 || !index2)
#  965|->         return ERROR_INT("calloc fail for array", __func__, 1);
#  966|       for (i = 0; i < nm; i++) {
#  967|           if (*psame == 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def365]
leptonica-1.87.0/src/classapp.c:965:16: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:963:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:965:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:965:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:965:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:965:16: throw: if ‘returnErrorInt’ throws an exception...
leptonica-1.87.0/src/classapp.c:965:16: danger: ‘index2’ leaks here; was allocated at [(7)](sarif:/runs/0/results/95/codeFlows/0/threadFlows/0/locations/6)
#  963|       index2 = (l_int32 *)LEPT_CALLOC(n2, sizeof(l_int32));
#  964|       if (!index1 || !index2)
#  965|->         return ERROR_INT("calloc fail for array", __func__, 1);
#  966|       for (i = 0; i < nm; i++) {
#  967|           if (*psame == 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def366]
leptonica-1.87.0/src/classapp.c:965:16: warning[-Wanalyzer-malloc-leak]: leak of ‘line1’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:782:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  963|       index2 = (l_int32 *)LEPT_CALLOC(n2, sizeof(l_int32));
#  964|       if (!index1 || !index2)
#  965|->         return ERROR_INT("calloc fail for array", __func__, 1);
#  966|       for (i = 0; i < nm; i++) {
#  967|           if (*psame == 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def367]
leptonica-1.87.0/src/classapp.c:965:16: warning[-Wanalyzer-malloc-leak]: leak of ‘line2’
leptonica-1.87.0/src/classapp.c:744:1: enter_function: entry to ‘numaaCompareImagesByBoxes’
leptonica-1.87.0/src/classapp.c:762:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:764:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:765:8: branch_false: following ‘false’ branch (when ‘naa1’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:767:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:767:8: branch_false: following ‘false’ branch (when ‘naa2’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:769:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:769:8: branch_false: following ‘false’ branch (when ‘nperline > 0’)...
leptonica-1.87.0/src/classapp.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:771:8: branch_false: following ‘false’ branch (when ‘nreq > 0’)...
leptonica-1.87.0/src/classapp.c:774:10: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:776:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:782:24: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:783:24: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:788:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:797:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:798:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:806:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:807:15: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:811:12: branch_true: following ‘true’ branch (when ‘nperline <= nbox’)...
leptonica-1.87.0/src/classapp.c:812:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:827:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:828:18: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:832:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:833:22: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:833:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:834:23: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:859:5: call_function: calling ‘countAlignedMatches’ from ‘numaaCompareImagesByBoxes’
#  963|       index2 = (l_int32 *)LEPT_CALLOC(n2, sizeof(l_int32));
#  964|       if (!index1 || !index2)
#  965|->         return ERROR_INT("calloc fail for array", __func__, 1);
#  966|       for (i = 0; i < nm; i++) {
#  967|           if (*psame == 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def368]
leptonica-1.87.0/src/classapp.c:1010:1: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:962:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:965:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:1010:1: danger: ‘index1’ leaks here; was allocated at [(7)](sarif:/runs/0/results/100/codeFlows/0/threadFlows/0/locations/6)
# 1008|       LEPT_FREE(index2);
# 1009|       return 0;
# 1010|-> }
# 1011|   
# 1012|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def369]
leptonica-1.87.0/src/classapp.c:1010:1: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:963:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:965:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:1010:1: danger: ‘index2’ leaks here; was allocated at [(7)](sarif:/runs/0/results/101/codeFlows/0/threadFlows/0/locations/6)
# 1008|       LEPT_FREE(index2);
# 1009|       return 0;
# 1010|-> }
# 1011|   
# 1012|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def370]
leptonica-1.87.0/src/classapp.c:1021:5: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:962:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1019|   l_int32  i;
# 1020|   
# 1021|->     lept_stderr("Index1: ");
# 1022|       for (i = 0; i < n1; i++) {
# 1023|           if (i && (i % 20 == 0))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def371]
leptonica-1.87.0/src/classapp.c:1021:5: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:963:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1019|   l_int32  i;
# 1020|   
# 1021|->     lept_stderr("Index1: ");
# 1022|       for (i = 0; i < n1; i++) {
# 1023|           if (i && (i % 20 == 0))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def372]
leptonica-1.87.0/src/classapp.c:1024:13: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:962:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1022|       for (i = 0; i < n1; i++) {
# 1023|           if (i && (i % 20 == 0))
# 1024|->             lept_stderr("\n        ");
# 1025|           lept_stderr("%3d", index1[i]);
# 1026|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def373]
leptonica-1.87.0/src/classapp.c:1024:13: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:963:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1022|       for (i = 0; i < n1; i++) {
# 1023|           if (i && (i % 20 == 0))
# 1024|->             lept_stderr("\n        ");
# 1025|           lept_stderr("%3d", index1[i]);
# 1026|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def374]
leptonica-1.87.0/src/classapp.c:1025:9: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:962:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1023|           if (i && (i % 20 == 0))
# 1024|               lept_stderr("\n        ");
# 1025|->         lept_stderr("%3d", index1[i]);
# 1026|       }
# 1027|       lept_stderr("\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def375]
leptonica-1.87.0/src/classapp.c:1025:9: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:963:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1023|           if (i && (i % 20 == 0))
# 1024|               lept_stderr("\n        ");
# 1025|->         lept_stderr("%3d", index1[i]);
# 1026|       }
# 1027|       lept_stderr("\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def376]
leptonica-1.87.0/src/classapp.c:1027:5: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:962:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1025|           lept_stderr("%3d", index1[i]);
# 1026|       }
# 1027|->     lept_stderr("\n");
# 1028|   
# 1029|       lept_stderr("Index2: ");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def377]
leptonica-1.87.0/src/classapp.c:1027:5: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:963:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1025|           lept_stderr("%3d", index1[i]);
# 1026|       }
# 1027|->     lept_stderr("\n");
# 1028|   
# 1029|       lept_stderr("Index2: ");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def378]
leptonica-1.87.0/src/classapp.c:1029:5: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:962:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1027|       lept_stderr("\n");
# 1028|   
# 1029|->     lept_stderr("Index2: ");
# 1030|       for (i = 0; i < n2; i++) {
# 1031|           if (i && (i % 20 == 0))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def379]
leptonica-1.87.0/src/classapp.c:1029:5: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:963:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1027|       lept_stderr("\n");
# 1028|   
# 1029|->     lept_stderr("Index2: ");
# 1030|       for (i = 0; i < n2; i++) {
# 1031|           if (i && (i % 20 == 0))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def380]
leptonica-1.87.0/src/classapp.c:1032:13: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:962:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1030|       for (i = 0; i < n2; i++) {
# 1031|           if (i && (i % 20 == 0))
# 1032|->             lept_stderr("\n        ");
# 1033|           lept_stderr("%3d", index2[i]);
# 1034|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def381]
leptonica-1.87.0/src/classapp.c:1032:13: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:963:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1030|       for (i = 0; i < n2; i++) {
# 1031|           if (i && (i % 20 == 0))
# 1032|->             lept_stderr("\n        ");
# 1033|           lept_stderr("%3d", index2[i]);
# 1034|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def382]
leptonica-1.87.0/src/classapp.c:1033:9: warning[-Wanalyzer-malloc-leak]: leak of ‘index1’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:962:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1031|           if (i && (i % 20 == 0))
# 1032|               lept_stderr("\n        ");
# 1033|->         lept_stderr("%3d", index2[i]);
# 1034|       }
# 1035|       lept_stderr("\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def383]
leptonica-1.87.0/src/classapp.c:1033:9: warning[-Wanalyzer-malloc-leak]: leak of ‘index2’
leptonica-1.87.0/src/classapp.c:927:1: enter_function: entry to ‘countAlignedMatches’
leptonica-1.87.0/src/classapp.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:944:8: branch_false: following ‘false’ branch (when ‘psame’ is non-NULL)...
leptonica-1.87.0/src/classapp.c:946:5: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:955:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:963:25: acquire_memory: allocated here
leptonica-1.87.0/src/classapp.c:964:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:964:8: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:966:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:967:13: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:967:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:971:27: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:978:12: branch_false: following ‘false’ branch (when ‘nreq != 1’)...
leptonica-1.87.0/src/classapp.c:978:12: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:983:16: branch_true: following ‘true’ branch (when ‘i == j’)...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:982:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/classapp.c:983:16: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:985:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:989:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/classapp.c:991:13: branch_false: ...to here
leptonica-1.87.0/src/classapp.c:994:16: branch_true: following ‘true’ branch (when ‘nreq <= nmatch’)...
leptonica-1.87.0/src/classapp.c:995:17: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:996:20: branch_true: following ‘true’ branch (when ‘debugflag != 0’)...
leptonica-1.87.0/src/classapp.c:997:21: branch_true: ...to here
leptonica-1.87.0/src/classapp.c:997:21: call_function: calling ‘printRowIndices’ from ‘countAlignedMatches’
# 1031|           if (i && (i % 20 == 0))
# 1032|               lept_stderr("\n        ");
# 1033|->         lept_stderr("%3d", index2[i]);
# 1034|       }
# 1035|       lept_stderr("\n");

Error: COMPILER_WARNING (CWE-457): [#def384]
leptonica-1.87.0/src/colorcontent.c: scope_hint: In function ‘pixColorContent’
leptonica-1.87.0/src/colorcontent.c:211:30: warning[-Wmaybe-uninitialized]: ‘wplr’ may be used uninitialized
#  211 | l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#      |                              ^~~~
#  209|                   PIX    **ppixb)
#  210|   {
#  211|-> l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#  212|   l_int32    rval, gval, bval, rgdiff, rbdiff, gbdiff, maxval, colorval;
#  213|   l_uint32   pixel;

Error: COMPILER_WARNING (CWE-457): [#def385]
leptonica-1.87.0/src/colorcontent.c:211:36: warning[-Wmaybe-uninitialized]: ‘wplg’ may be used uninitialized
#  211 | l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#      |                                    ^~~~
#  209|                   PIX    **ppixb)
#  210|   {
#  211|-> l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#  212|   l_int32    rval, gval, bval, rgdiff, rbdiff, gbdiff, maxval, colorval;
#  213|   l_uint32   pixel;

Error: COMPILER_WARNING (CWE-457): [#def386]
leptonica-1.87.0/src/colorcontent.c:211:42: warning[-Wmaybe-uninitialized]: ‘wplb’ may be used uninitialized
#  211 | l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#      |                                          ^~~~
#  209|                   PIX    **ppixb)
#  210|   {
#  211|-> l_int32    w, h, i, j, wpl1, wplr, wplg, wplb;
#  212|   l_int32    rval, gval, bval, rgdiff, rbdiff, gbdiff, maxval, colorval;
#  213|   l_uint32   pixel;

Error: CPPCHECK_WARNING (CWE-476): [#def387]
leptonica-1.87.0/src/colorcontent.c:1447: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: inta
# 1445|                   else  /* d == 2 */
# 1446|                       val = GET_DATA_DIBIT(line, j);
# 1447|->                 inta[val] = 1;
# 1448|               }
# 1449|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def388]
leptonica-1.87.0/src/colorcontent.c:1451:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘inta’
leptonica-1.87.0/src/colorcontent.c:1423:8: branch_false: following ‘false’ branch (when ‘pncolors’ is non-NULL)...
leptonica-1.87.0/src/colorcontent.c:1425:5: branch_false: ...to here
leptonica-1.87.0/src/colorcontent.c:1426:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/colorcontent.c:1428:5: branch_false: ...to here
leptonica-1.87.0/src/colorcontent.c:1436:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorcontent.c:1437:27: branch_true: ...to here
leptonica-1.87.0/src/colorcontent.c:1437:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/colorcontent.c:1450:21: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/colorcontent.c:1451:21: branch_true: ...to here
leptonica-1.87.0/src/colorcontent.c:1451:17: danger: ‘inta + (long unsigned int)i * 4’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 1449|           }
# 1450|           for (i = 0; i < 256; i++)
# 1451|->             if (inta[i]) sum++;
# 1452|           *pncolors = sum;
# 1453|           LEPT_FREE(inta);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def389]
leptonica-1.87.0/src/colorcontent.c:1473:13: warning[-Wanalyzer-malloc-leak]: leak of ‘inta’
leptonica-1.87.0/src/colorcontent.c:1423:8: branch_false: following ‘false’ branch (when ‘pncolors’ is non-NULL)...
leptonica-1.87.0/src/colorcontent.c:1425:5: branch_false: ...to here
leptonica-1.87.0/src/colorcontent.c:1426:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/colorcontent.c:1428:5: branch_false: ...to here
leptonica-1.87.0/src/colorcontent.c:1436:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorcontent.c:1467:23: branch_false: ...to here
leptonica-1.87.0/src/colorcontent.c:1467:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorcontent.c:1469:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorcontent.c:1471:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorcontent.c:1472:25: branch_true: ...to here
leptonica-1.87.0/src/colorcontent.c:1473:13: throw: if ‘extractRGBValues’ throws an exception...
leptonica-1.87.0/src/colorcontent.c:1473:13: danger: ‘inta’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
# 1471|           for (j = 0; j < w; j += factor) {
# 1472|               pixel = line[j];
# 1473|->             extractRGBValues(pixel, &rval, &gval, &bval);
# 1474|               val = (137 * rval + 269 * gval + 353 * bval) % hashsize;
# 1475|               if (inta[val] == 0) {

Error: CPPCHECK_WARNING (CWE-476): [#def390]
leptonica-1.87.0/src/colorcontent.c:1475: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: inta
# 1473|               extractRGBValues(pixel, &rval, &gval, &bval);
# 1474|               val = (137 * rval + 269 * gval + 353 * bval) % hashsize;
# 1475|->             if (inta[val] == 0) {
# 1476|                   inta[val] = 1;
# 1477|                   sum++;

Error: CPPCHECK_WARNING (CWE-476): [#def391]
leptonica-1.87.0/src/colorcontent.c:1565: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hasha1
# 1563|               extractRGBValues(pixel, &rval, &gval, &bval);
# 1564|               hashval = (137 * rval + 269 * gval + 353 * bval) % hashsize;
# 1565|->             if (hasha1[hashval] == 0) {  /* new color */
# 1566|                   hasha1[hashval] = 1;
# 1567|                   index++;

Error: CPPCHECK_WARNING (CWE-476): [#def392]
leptonica-1.87.0/src/colorcontent.c:1571: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hasha2
# 1569|                   pixcmapAddColor(cmap, rval, gval, bval);
# 1570|               }
# 1571|->             val = hasha2[hashval];
# 1572|               setLineDataVal(lined, j, d, val);
# 1573|           }

Error: CPPCHECK_WARNING (CWE-476): [#def393]
leptonica-1.87.0/src/colorfill.c:136: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cf
#  134|   
#  135|       cf = (L_COLORFILL *)LEPT_CALLOC(1, sizeof(L_COLORFILL));
#  136|->     cf->pixs = pixClone(pixs);
#  137|       cf->nx = nx;
#  138|       cf->ny = ny;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def394]
leptonica-1.87.0/src/colorfill.c:136:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cf’
leptonica-1.87.0/src/colorfill.c:116:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/colorfill.c:118:9: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:118:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorfill.c:121:5: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:124:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorfill.c:126:13: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:135:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/colorfill.c:136:5: danger: ‘cf’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  134|   
#  135|       cf = (L_COLORFILL *)LEPT_CALLOC(1, sizeof(L_COLORFILL));
#  136|->     cf->pixs = pixClone(pixs);
#  137|       cf->nx = nx;
#  138|       cf->ny = ny;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def395]
leptonica-1.87.0/src/colorfill.c:136:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cf’
leptonica-1.87.0/src/colorfill.c:116:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/colorfill.c:118:9: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:118:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorfill.c:121:5: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:124:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorfill.c:126:13: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:135:25: acquire_memory: allocated here
leptonica-1.87.0/src/colorfill.c:136:16: throw: if ‘pixClone’ throws an exception...
leptonica-1.87.0/src/colorfill.c:136:16: danger: ‘cf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  134|   
#  135|       cf = (L_COLORFILL *)LEPT_CALLOC(1, sizeof(L_COLORFILL));
#  136|->     cf->pixs = pixClone(pixs);
#  137|       cf->nx = nx;
#  138|       cf->ny = ny;

Error: CPPCHECK_WARNING (CWE-476): [#def396]
leptonica-1.87.0/src/colorfill.c:137: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cf
#  135|       cf = (L_COLORFILL *)LEPT_CALLOC(1, sizeof(L_COLORFILL));
#  136|       cf->pixs = pixClone(pixs);
#  137|->     cf->nx = nx;
#  138|       cf->ny = ny;
#  139|       cf->tw = tw;

Error: CPPCHECK_WARNING (CWE-476): [#def397]
leptonica-1.87.0/src/colorfill.c:138: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cf
#  136|       cf->pixs = pixClone(pixs);
#  137|       cf->nx = nx;
#  138|->     cf->ny = ny;
#  139|       cf->tw = tw;
#  140|       cf->th = th;

Error: CPPCHECK_WARNING (CWE-476): [#def398]
leptonica-1.87.0/src/colorfill.c:139: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cf
#  137|       cf->nx = nx;
#  138|       cf->ny = ny;
#  139|->     cf->tw = tw;
#  140|       cf->th = th;
#  141|       cf->boxas = boxas;

Error: CPPCHECK_WARNING (CWE-476): [#def399]
leptonica-1.87.0/src/colorfill.c:140: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cf
#  138|       cf->ny = ny;
#  139|       cf->tw = tw;
#  140|->     cf->th = th;
#  141|       cf->boxas = boxas;
#  142|       cf->naa = numaaCreate(ntiles);

Error: CPPCHECK_WARNING (CWE-476): [#def400]
leptonica-1.87.0/src/colorfill.c:141: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cf
#  139|       cf->tw = tw;
#  140|       cf->th = th;
#  141|->     cf->boxas = boxas;
#  142|       cf->naa = numaaCreate(ntiles);
#  143|       cf->dnaa = l_dnaaCreate(ntiles);

Error: CPPCHECK_WARNING (CWE-476): [#def401]
leptonica-1.87.0/src/colorfill.c:142: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cf
#  140|       cf->th = th;
#  141|       cf->boxas = boxas;
#  142|->     cf->naa = numaaCreate(ntiles);
#  143|       cf->dnaa = l_dnaaCreate(ntiles);
#  144|       cf->pixadb = pixaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def402]
leptonica-1.87.0/src/colorfill.c:142:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cf’
leptonica-1.87.0/src/colorfill.c:116:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/colorfill.c:118:9: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:118:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorfill.c:121:5: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:124:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorfill.c:126:13: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:135:25: acquire_memory: allocated here
leptonica-1.87.0/src/colorfill.c:142:15: throw: if ‘numaaCreate’ throws an exception...
leptonica-1.87.0/src/colorfill.c:142:15: danger: ‘cf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  140|       cf->th = th;
#  141|       cf->boxas = boxas;
#  142|->     cf->naa = numaaCreate(ntiles);
#  143|       cf->dnaa = l_dnaaCreate(ntiles);
#  144|       cf->pixadb = pixaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def403]
leptonica-1.87.0/src/colorfill.c:143: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cf
#  141|       cf->boxas = boxas;
#  142|       cf->naa = numaaCreate(ntiles);
#  143|->     cf->dnaa = l_dnaaCreate(ntiles);
#  144|       cf->pixadb = pixaCreate(0);
#  145|       return cf;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def404]
leptonica-1.87.0/src/colorfill.c:143:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cf’
leptonica-1.87.0/src/colorfill.c:116:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/colorfill.c:118:9: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:118:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorfill.c:121:5: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:124:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorfill.c:126:13: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:135:25: acquire_memory: allocated here
leptonica-1.87.0/src/colorfill.c:143:16: throw: if ‘l_dnaaCreate’ throws an exception...
leptonica-1.87.0/src/colorfill.c:143:16: danger: ‘cf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  141|       cf->boxas = boxas;
#  142|       cf->naa = numaaCreate(ntiles);
#  143|->     cf->dnaa = l_dnaaCreate(ntiles);
#  144|       cf->pixadb = pixaCreate(0);
#  145|       return cf;

Error: CPPCHECK_WARNING (CWE-476): [#def405]
leptonica-1.87.0/src/colorfill.c:144: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cf
#  142|       cf->naa = numaaCreate(ntiles);
#  143|       cf->dnaa = l_dnaaCreate(ntiles);
#  144|->     cf->pixadb = pixaCreate(0);
#  145|       return cf;
#  146|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def406]
leptonica-1.87.0/src/colorfill.c:144:18: warning[-Wanalyzer-malloc-leak]: leak of ‘cf’
leptonica-1.87.0/src/colorfill.c:116:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/colorfill.c:118:9: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:118:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorfill.c:121:5: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:124:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorfill.c:126:13: branch_false: ...to here
leptonica-1.87.0/src/colorfill.c:135:25: acquire_memory: allocated here
leptonica-1.87.0/src/colorfill.c:144:18: throw: if ‘pixaCreate’ throws an exception...
leptonica-1.87.0/src/colorfill.c:144:18: danger: ‘cf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  142|       cf->naa = numaaCreate(ntiles);
#  143|       cf->dnaa = l_dnaaCreate(ntiles);
#  144|->     cf->pixadb = pixaCreate(0);
#  145|       return cf;
#  146|   }

Error: CPPCHECK_WARNING (CWE-476): [#def407]
leptonica-1.87.0/src/colorfill.c:498: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: el
#  496|   
#  497|       el = (COLOREL *)LEPT_CALLOC(1, sizeof(COLOREL));
#  498|->     el->x = x;
#  499|       el->y = y;
#  500|       el->color = color;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def408]
leptonica-1.87.0/src/colorfill.c:498:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘el’
leptonica-1.87.0/src/colorfill.c:529:1: enter_function: entry to ‘pixColorFillFromSeed’
leptonica-1.87.0/src/colorfill.c:547:10: call_function: inlined call to ‘colorelCreate’ from ‘pixColorFillFromSeed’
#  496|   
#  497|       el = (COLOREL *)LEPT_CALLOC(1, sizeof(COLOREL));
#  498|->     el->x = x;
#  499|       el->y = y;
#  500|       el->color = color;

Error: CPPCHECK_WARNING (CWE-476): [#def409]
leptonica-1.87.0/src/colorfill.c:499: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: el
#  497|       el = (COLOREL *)LEPT_CALLOC(1, sizeof(COLOREL));
#  498|       el->x = x;
#  499|->     el->y = y;
#  500|       el->color = color;
#  501|       return el;

Error: CPPCHECK_WARNING (CWE-476): [#def410]
leptonica-1.87.0/src/colorfill.c:500: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: el
#  498|       el->x = x;
#  499|       el->y = y;
#  500|->     el->color = color;
#  501|       return el;
#  502|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def411]
leptonica-1.87.0/src/colorfill.c:548:5: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/colorfill.c:529:1: enter_function: entry to ‘pixColorFillFromSeed’
leptonica-1.87.0/src/colorfill.c:547:10: call_function: inlined call to ‘colorelCreate’ from ‘pixColorFillFromSeed’
leptonica-1.87.0/src/colorfill.c:548:5: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/colorfill.c:548:5: danger: ‘el’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  546|       pixGetPixel(pixs, x, y, &val);
#  547|       el = colorelCreate(x, y, val);
#  548|->     lqueueAdd(lq, el);
#  549|       pixSetPixel(pixv, x, y, 1);  /* visited */
#  550|       pta = ptaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def412]
leptonica-1.87.0/src/coloring.c:621:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tab’
leptonica-1.87.0/src/coloring.c:576:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:578:9: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:578:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:581:8: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:619:22: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:620:17: branch_true: following ‘true’ branch (when ‘i < ncolors’)...
leptonica-1.87.0/src/coloring.c:621:9: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:621:9: throw: if ‘pixcmapGetColor’ throws an exception...
leptonica-1.87.0/src/coloring.c:621:9: danger: ‘tab’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  619|       tab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  620|       for (i = 0; i < ncolors; i++) {
#  621|->         pixcmapGetColor(cmap, i, &rval, &gval, &bval);
#  622|           if ((L_ABS(rval - rsval) <= diff) &&
#  623|               (L_ABS(gval - gsval) <= diff) &&

Error: GCC_ANALYZER_WARNING (CWE-476): [#def413]
leptonica-1.87.0/src/coloring.c:625:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/coloring.c:576:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:578:9: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:578:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:581:8: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:619:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/coloring.c:620:17: branch_true: following ‘true’ branch (when ‘i < ncolors’)...
leptonica-1.87.0/src/coloring.c:621:9: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:622:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:623:14: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:622:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:624:14: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:622:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:625:16: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:625:13: danger: ‘tab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  623|               (L_ABS(gval - gsval) <= diff) &&
#  624|               (L_ABS(bval - bsval) <= diff))
#  625|->             tab[i] = 1;
#  626|       }
#  627|       pixm = pixMakeMaskFromLUT(pixd, tab);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def414]
leptonica-1.87.0/src/coloring.c:627:12: warning[-Wanalyzer-malloc-leak]: leak of ‘tab’
leptonica-1.87.0/src/coloring.c:576:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:578:9: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:578:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:581:8: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:619:22: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:627:12: throw: if ‘pixMakeMaskFromLUT’ throws an exception...
leptonica-1.87.0/src/coloring.c:627:12: danger: ‘tab’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  625|               tab[i] = 1;
#  626|       }
#  627|->     pixm = pixMakeMaskFromLUT(pixd, tab);
#  628|       LEPT_FREE(tab);
#  629|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def415]
leptonica-1.87.0/src/coloring.c:706:16: warning[-Wanalyzer-malloc-leak]: leak of ‘btab’
leptonica-1.87.0/src/coloring.c:690:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:694:8: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:704:23: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:705:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:706:23: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:706:16: danger: ‘btab’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  704|       btab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  705|       if (!rtab || !gtab || !btab)
#  706|->         return (PIX *)ERROR_PTR("calloc fail for tab", __func__, pixd);
#  707|       for (i = 0; i < 256; i++) {
#  708|           if (i <= rsval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def416]
leptonica-1.87.0/src/coloring.c:706:16: warning[-Wanalyzer-malloc-leak]: leak of ‘gtab’
leptonica-1.87.0/src/coloring.c:690:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:694:8: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:703:23: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:705:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:706:23: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:706:16: danger: ‘gtab’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  704|       btab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  705|       if (!rtab || !gtab || !btab)
#  706|->         return (PIX *)ERROR_PTR("calloc fail for tab", __func__, pixd);
#  707|       for (i = 0; i < 256; i++) {
#  708|           if (i <= rsval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def417]
leptonica-1.87.0/src/coloring.c:706:16: warning[-Wanalyzer-malloc-leak]: leak of ‘rtab’
leptonica-1.87.0/src/coloring.c:690:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:694:8: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:702:23: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:705:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:706:23: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:706:16: danger: ‘rtab’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  704|       btab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  705|       if (!rtab || !gtab || !btab)
#  706|->         return (PIX *)ERROR_PTR("calloc fail for tab", __func__, pixd);
#  707|       for (i = 0; i < 256; i++) {
#  708|           if (i <= rsval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def418]
leptonica-1.87.0/src/coloring.c:706:23: warning[-Wanalyzer-malloc-leak]: leak of ‘btab’
leptonica-1.87.0/src/coloring.c:690:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:694:8: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:704:23: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:705:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:706:23: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:706:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:706:23: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:706:23: throw: if ‘returnErrorPtr’ throws an exception...
leptonica-1.87.0/src/coloring.c:706:23: danger: ‘btab’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  704|       btab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  705|       if (!rtab || !gtab || !btab)
#  706|->         return (PIX *)ERROR_PTR("calloc fail for tab", __func__, pixd);
#  707|       for (i = 0; i < 256; i++) {
#  708|           if (i <= rsval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def419]
leptonica-1.87.0/src/coloring.c:706:23: warning[-Wanalyzer-malloc-leak]: leak of ‘gtab’
leptonica-1.87.0/src/coloring.c:690:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:694:8: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:703:23: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:705:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:706:23: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:706:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:706:23: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:706:23: throw: if ‘returnErrorPtr’ throws an exception...
leptonica-1.87.0/src/coloring.c:706:23: danger: ‘gtab’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  704|       btab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  705|       if (!rtab || !gtab || !btab)
#  706|->         return (PIX *)ERROR_PTR("calloc fail for tab", __func__, pixd);
#  707|       for (i = 0; i < 256; i++) {
#  708|           if (i <= rsval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def420]
leptonica-1.87.0/src/coloring.c:706:23: warning[-Wanalyzer-malloc-leak]: leak of ‘rtab’
leptonica-1.87.0/src/coloring.c:690:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:694:8: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:702:23: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:705:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:706:23: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:706:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:706:23: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:706:23: throw: if ‘returnErrorPtr’ throws an exception...
leptonica-1.87.0/src/coloring.c:706:23: danger: ‘rtab’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  704|       btab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  705|       if (!rtab || !gtab || !btab)
#  706|->         return (PIX *)ERROR_PTR("calloc fail for tab", __func__, pixd);
#  707|       for (i = 0; i < 256; i++) {
#  708|           if (i <= rsval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def421]
leptonica-1.87.0/src/coloring.c:888:9: warning[-Wanalyzer-malloc-leak]: leak of ‘btab’
leptonica-1.87.0/src/coloring.c:865:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/coloring.c:867:9: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:867:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:869:9: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:877:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:882:5: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:886:23: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:887:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:888:9: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:888:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:888:9: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:888:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/coloring.c:888:9: danger: ‘btab’ leaks here; was allocated at [(7)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/6)
#  886|       btab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  887|       if (!rtab || !gtab || !btab) {
#  888|->         L_ERROR("calloc fail for tab\n", __func__);
#  889|           goto cleanup;
#  890|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def422]
leptonica-1.87.0/src/coloring.c:888:9: warning[-Wanalyzer-malloc-leak]: leak of ‘gtab’
leptonica-1.87.0/src/coloring.c:865:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/coloring.c:867:9: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:867:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:869:9: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:877:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:882:5: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:885:23: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:887:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:888:9: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:888:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:888:9: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:888:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/coloring.c:888:9: danger: ‘gtab’ leaks here; was allocated at [(7)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/6)
#  886|       btab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  887|       if (!rtab || !gtab || !btab) {
#  888|->         L_ERROR("calloc fail for tab\n", __func__);
#  889|           goto cleanup;
#  890|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def423]
leptonica-1.87.0/src/coloring.c:888:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rtab’
leptonica-1.87.0/src/coloring.c:865:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/coloring.c:867:9: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:867:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:869:9: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:877:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/coloring.c:882:5: branch_false: ...to here
leptonica-1.87.0/src/coloring.c:884:23: acquire_memory: allocated here
leptonica-1.87.0/src/coloring.c:887:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:888:9: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:888:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/coloring.c:888:9: branch_true: ...to here
leptonica-1.87.0/src/coloring.c:888:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/coloring.c:888:9: danger: ‘rtab’ leaks here; was allocated at [(7)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/6)
#  886|       btab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  887|       if (!rtab || !gtab || !btab) {
#  888|->         L_ERROR("calloc fail for tab\n", __func__);
#  889|           goto cleanup;
#  890|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def424]
leptonica-1.87.0/src/colormap.c:131:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcmapCreate(4)’
leptonica-1.87.0/src/colormap.c:1697:1: enter_function: entry to ‘pixcmapConvertTo4’
leptonica-1.87.0/src/colormap.c:1702:8: branch_false: following ‘false’ branch (when ‘cmaps’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:1704:9: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1704:9: call_function: calling ‘pixcmapGetDepth’ from ‘pixcmapConvertTo4’
leptonica-1.87.0/src/colormap.c:1704:9: return_function: returning to ‘pixcmapConvertTo4’ from ‘pixcmapGetDepth’
leptonica-1.87.0/src/colormap.c:1704:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1707:13: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1707:13: call_function: calling ‘pixcmapCreate’ from ‘pixcmapConvertTo4’
leptonica-1.87.0/src/colormap.c:1707:13: return_function: returning to ‘pixcmapConvertTo4’ from ‘pixcmapCreate’
leptonica-1.87.0/src/colormap.c:1708:9: call_function: calling ‘pixcmapGetCount’ from ‘pixcmapConvertTo4’
leptonica-1.87.0/src/colormap.c:1708:9: return_function: returning to ‘pixcmapConvertTo4’ from ‘pixcmapGetCount’
leptonica-1.87.0/src/colormap.c:1709:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colormap.c:1710:9: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:1710:9: call_function: calling ‘pixcmapGetColor’ from ‘pixcmapConvertTo4’
#  129|   PIXCMAP    *cmap;
#  130|   
#  131|->     if (depth != 1 && depth != 2 && depth !=4 && depth != 8)
#  132|           return (PIXCMAP *)ERROR_PTR("depth not in {1,2,4,8}", __func__, NULL);
#  133|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def425]
leptonica-1.87.0/src/colormap.c:131:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcmapCreate(8)’
leptonica-1.87.0/src/colormap.c:1730:1: enter_function: entry to ‘pixcmapConvertTo8’
leptonica-1.87.0/src/colormap.c:1735:8: branch_false: following ‘false’ branch (when ‘cmaps’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:1737:13: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1737:13: call_function: calling ‘pixcmapGetDepth’ from ‘pixcmapConvertTo8’
leptonica-1.87.0/src/colormap.c:1737:13: return_function: returning to ‘pixcmapConvertTo8’ from ‘pixcmapGetDepth’
leptonica-1.87.0/src/colormap.c:1738:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1739:9: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1739:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1742:13: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1742:13: call_function: calling ‘pixcmapCreate’ from ‘pixcmapConvertTo8’
leptonica-1.87.0/src/colormap.c:1742:13: return_function: returning to ‘pixcmapConvertTo8’ from ‘pixcmapCreate’
leptonica-1.87.0/src/colormap.c:1743:9: call_function: calling ‘pixcmapGetCount’ from ‘pixcmapConvertTo8’
leptonica-1.87.0/src/colormap.c:1743:9: return_function: returning to ‘pixcmapConvertTo8’ from ‘pixcmapGetCount’
leptonica-1.87.0/src/colormap.c:1744:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colormap.c:1745:9: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:1745:9: call_function: calling ‘pixcmapGetColor’ from ‘pixcmapConvertTo8’
#  129|   PIXCMAP    *cmap;
#  130|   
#  131|->     if (depth != 1 && depth != 2 && depth !=4 && depth != 8)
#  132|           return (PIXCMAP *)ERROR_PTR("depth not in {1,2,4,8}", __func__, NULL);
#  133|   

Error: CPPCHECK_WARNING (CWE-476): [#def426]
leptonica-1.87.0/src/colormap.c:135: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmap
#  133|   
#  134|       cmap = (PIXCMAP *)LEPT_CALLOC(1, sizeof(PIXCMAP));
#  135|->     cmap->depth = depth;
#  136|       cmap->nalloc = 1 << depth;
#  137|       cta = (RGBA_QUAD *)LEPT_CALLOC(cmap->nalloc, sizeof(RGBA_QUAD));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def427]
leptonica-1.87.0/src/colormap.c:135:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cmap’
leptonica-1.87.0/src/colormap.c:1610:1: enter_function: entry to ‘pixcmapGrayToColor’
leptonica-1.87.0/src/colormap.c:1616:12: call_function: calling ‘pixcmapCreate’ from ‘pixcmapGrayToColor’
#  133|   
#  134|       cmap = (PIXCMAP *)LEPT_CALLOC(1, sizeof(PIXCMAP));
#  135|->     cmap->depth = depth;
#  136|       cmap->nalloc = 1 << depth;
#  137|       cta = (RGBA_QUAD *)LEPT_CALLOC(cmap->nalloc, sizeof(RGBA_QUAD));

Error: CPPCHECK_WARNING (CWE-476): [#def428]
leptonica-1.87.0/src/colormap.c:136: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmap
#  134|       cmap = (PIXCMAP *)LEPT_CALLOC(1, sizeof(PIXCMAP));
#  135|       cmap->depth = depth;
#  136|->     cmap->nalloc = 1 << depth;
#  137|       cta = (RGBA_QUAD *)LEPT_CALLOC(cmap->nalloc, sizeof(RGBA_QUAD));
#  138|       cmap->array = cta;

Error: CPPCHECK_WARNING (CWE-476): [#def429]
leptonica-1.87.0/src/colormap.c:137: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmap
#  135|       cmap->depth = depth;
#  136|       cmap->nalloc = 1 << depth;
#  137|->     cta = (RGBA_QUAD *)LEPT_CALLOC(cmap->nalloc, sizeof(RGBA_QUAD));
#  138|       cmap->array = cta;
#  139|       cmap->n = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def430]
leptonica-1.87.0/src/colormap.c:138: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmap
#  136|       cmap->nalloc = 1 << depth;
#  137|       cta = (RGBA_QUAD *)LEPT_CALLOC(cmap->nalloc, sizeof(RGBA_QUAD));
#  138|->     cmap->array = cta;
#  139|       cmap->n = 0;
#  140|       return cmap;

Error: CPPCHECK_WARNING (CWE-476): [#def431]
leptonica-1.87.0/src/colormap.c:139: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmap
#  137|       cta = (RGBA_QUAD *)LEPT_CALLOC(cmap->nalloc, sizeof(RGBA_QUAD));
#  138|       cmap->array = cta;
#  139|->     cmap->n = 0;
#  140|       return cmap;
#  141|   }

Error: CPPCHECK_WARNING (CWE-476): [#def432]
leptonica-1.87.0/src/colormap.c:256: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmapd
#  254|       cmapd = (PIXCMAP *)LEPT_CALLOC(1, sizeof(PIXCMAP));
#  255|       nbytes = cmaps->nalloc * sizeof(RGBA_QUAD);
#  256|->     cmapd->array = (void *)LEPT_CALLOC(1, nbytes);
#  257|       memcpy(cmapd->array, cmaps->array, cmaps->n * sizeof(RGBA_QUAD));
#  258|       cmapd->n = cmaps->n;

Error: CPPCHECK_WARNING (CWE-476): [#def433]
leptonica-1.87.0/src/colormap.c:257: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmapd
#  255|       nbytes = cmaps->nalloc * sizeof(RGBA_QUAD);
#  256|       cmapd->array = (void *)LEPT_CALLOC(1, nbytes);
#  257|->     memcpy(cmapd->array, cmaps->array, cmaps->n * sizeof(RGBA_QUAD));
#  258|       cmapd->n = cmaps->n;
#  259|       cmapd->nalloc = cmaps->nalloc;

Error: CPPCHECK_WARNING (CWE-476): [#def434]
leptonica-1.87.0/src/colormap.c:258: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmapd
#  256|       cmapd->array = (void *)LEPT_CALLOC(1, nbytes);
#  257|       memcpy(cmapd->array, cmaps->array, cmaps->n * sizeof(RGBA_QUAD));
#  258|->     cmapd->n = cmaps->n;
#  259|       cmapd->nalloc = cmaps->nalloc;
#  260|       cmapd->depth = cmaps->depth;

Error: CPPCHECK_WARNING (CWE-476): [#def435]
leptonica-1.87.0/src/colormap.c:259: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmapd
#  257|       memcpy(cmapd->array, cmaps->array, cmaps->n * sizeof(RGBA_QUAD));
#  258|       cmapd->n = cmaps->n;
#  259|->     cmapd->nalloc = cmaps->nalloc;
#  260|       cmapd->depth = cmaps->depth;
#  261|       return cmapd;

Error: CPPCHECK_WARNING (CWE-476): [#def436]
leptonica-1.87.0/src/colormap.c:260: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmapd
#  258|       cmapd->n = cmaps->n;
#  259|       cmapd->nalloc = cmaps->nalloc;
#  260|->     cmapd->depth = cmaps->depth;
#  261|       return cmapd;
#  262|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def437]
leptonica-1.87.0/src/colormap.c:417:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cta’
leptonica-1.87.0/src/colormap.c:1610:1: enter_function: entry to ‘pixcmapGrayToColor’
leptonica-1.87.0/src/colormap.c:1616:12: call_function: calling ‘pixcmapCreate’ from ‘pixcmapGrayToColor’
leptonica-1.87.0/src/colormap.c:1616:12: return_function: returning to ‘pixcmapGrayToColor’ from ‘pixcmapCreate’
leptonica-1.87.0/src/colormap.c:1617:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/colormap.c:1620:37: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:1618:9: call_function: calling ‘pixcmapAddColor’ from ‘pixcmapGrayToColor’
#  415|   
#  416|       cta = (RGBA_QUAD *)cmap->array;
#  417|->     cta[cmap->n].red = rval;
#  418|       cta[cmap->n].green = gval;
#  419|       cta[cmap->n].blue = bval;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def438]
leptonica-1.87.0/src/colormap.c:451:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/colormap.c:1789:1: enter_function: entry to ‘pixcmapReadStream’
leptonica-1.87.0/src/colormap.c:1800:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1801:10: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1800:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1804:14: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1807:17: call_function: calling ‘pixcmapCreate’ from ‘pixcmapReadStream’
leptonica-1.87.0/src/colormap.c:1807:17: return_function: returning to ‘pixcmapReadStream’ from ‘pixcmapCreate’
leptonica-1.87.0/src/colormap.c:1807:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1807:8: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1809:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colormap.c:1810:13: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:1810:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1815:9: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1815:9: call_function: calling ‘pixcmapAddRGBA’ from ‘pixcmapReadStream’
#  449|           return ERROR_INT("cmap not defined", __func__, 1);
#  450|       if (cmap->n >= cmap->nalloc)
#  451|->         return ERROR_INT("no free color entries", __func__, 1);
#  452|   
#  453|       cta = (RGBA_QUAD *)cmap->array;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def439]
leptonica-1.87.0/src/colormap.c:451:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cmap’
leptonica-1.87.0/src/colormap.c:1789:1: enter_function: entry to ‘pixcmapReadStream’
leptonica-1.87.0/src/colormap.c:1800:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1801:10: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1800:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1804:14: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1807:17: call_function: calling ‘pixcmapCreate’ from ‘pixcmapReadStream’
leptonica-1.87.0/src/colormap.c:1807:17: return_function: returning to ‘pixcmapReadStream’ from ‘pixcmapCreate’
leptonica-1.87.0/src/colormap.c:1807:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1807:8: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1809:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colormap.c:1810:13: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:1810:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1815:9: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1815:9: call_function: calling ‘pixcmapAddRGBA’ from ‘pixcmapReadStream’
#  449|           return ERROR_INT("cmap not defined", __func__, 1);
#  450|       if (cmap->n >= cmap->nalloc)
#  451|->         return ERROR_INT("no free color entries", __func__, 1);
#  452|   
#  453|       cta = (RGBA_QUAD *)cmap->array;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def440]
leptonica-1.87.0/src/colormap.c:454:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cta’
leptonica-1.87.0/src/colormap.c:1789:1: enter_function: entry to ‘pixcmapReadStream’
leptonica-1.87.0/src/colormap.c:1800:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1801:10: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1800:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1804:14: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1807:17: call_function: calling ‘pixcmapCreate’ from ‘pixcmapReadStream’
leptonica-1.87.0/src/colormap.c:1807:17: return_function: returning to ‘pixcmapReadStream’ from ‘pixcmapCreate’
leptonica-1.87.0/src/colormap.c:1807:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1807:8: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1809:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colormap.c:1810:13: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:1810:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1815:9: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1815:9: call_function: calling ‘pixcmapAddRGBA’ from ‘pixcmapReadStream’
#  452|   
#  453|       cta = (RGBA_QUAD *)cmap->array;
#  454|->     cta[cmap->n].red = rval;
#  455|       cta[cmap->n].green = gval;
#  456|       cta[cmap->n].blue = bval;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def441]
leptonica-1.87.0/src/colormap.c:804:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/colormap.c:1697:1: enter_function: entry to ‘pixcmapConvertTo4’
leptonica-1.87.0/src/colormap.c:1702:8: branch_false: following ‘false’ branch (when ‘cmaps’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:1704:9: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1704:9: call_function: calling ‘pixcmapGetDepth’ from ‘pixcmapConvertTo4’
leptonica-1.87.0/src/colormap.c:1704:9: return_function: returning to ‘pixcmapConvertTo4’ from ‘pixcmapGetDepth’
leptonica-1.87.0/src/colormap.c:1704:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:1707:13: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1707:13: call_function: calling ‘pixcmapCreate’ from ‘pixcmapConvertTo4’
leptonica-1.87.0/src/colormap.c:1707:13: return_function: returning to ‘pixcmapConvertTo4’ from ‘pixcmapCreate’
leptonica-1.87.0/src/colormap.c:1708:9: call_function: calling ‘pixcmapGetCount’ from ‘pixcmapConvertTo4’
leptonica-1.87.0/src/colormap.c:1708:9: return_function: returning to ‘pixcmapConvertTo4’ from ‘pixcmapGetCount’
leptonica-1.87.0/src/colormap.c:1709:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colormap.c:1710:9: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:1710:9: call_function: calling ‘pixcmapGetColor’ from ‘pixcmapConvertTo4’
#  802|           return ERROR_INT("cmap not defined", __func__, 1);
#  803|       if (index < 0 || index >= cmap->n)
#  804|->         return ERROR_INT("index out of bounds", __func__, 1);
#  805|   
#  806|       cta = (RGBA_QUAD *)cmap->array;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def442]
leptonica-1.87.0/src/colormap.c:804:16: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/colormap.c:1205:1: enter_function: entry to ‘pixcmapCountGrayColors’
leptonica-1.87.0/src/colormap.c:1211:8: branch_false: following ‘false’ branch (when ‘pngray’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:1213:5: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1214:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:1217:24: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1217:24: acquire_memory: allocated here
leptonica-1.87.0/src/colormap.c:1218:9: call_function: calling ‘pixcmapGetCount’ from ‘pixcmapCountGrayColors’
leptonica-1.87.0/src/colormap.c:1218:9: return_function: returning to ‘pixcmapCountGrayColors’ from ‘pixcmapGetCount’
leptonica-1.87.0/src/colormap.c:1220:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colormap.c:1221:9: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:1221:9: call_function: calling ‘pixcmapGetColor’ from ‘pixcmapCountGrayColors’
#  802|           return ERROR_INT("cmap not defined", __func__, 1);
#  803|       if (index < 0 || index >= cmap->n)
#  804|->         return ERROR_INT("index out of bounds", __func__, 1);
#  805|   
#  806|       cta = (RGBA_QUAD *)cmap->array;

Error: CPPCHECK_WARNING (CWE-476): [#def443]
leptonica-1.87.0/src/colormap.c:1222: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: array
# 1220|       for (i = 0; i < n; i++) {
# 1221|           pixcmapGetColor(cmap, i, &rval, &gval, &bval);
# 1222|->         if ((rval == gval) && (rval == bval) && (array[rval] == 0)) {
# 1223|               array[rval] = 1;
# 1224|               count++;

Error: CPPCHECK_WARNING (CWE-476): [#def444]
leptonica-1.87.0/src/colormap.c:1560: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: curve
# 1558|       for (i = 0; i < 64; i++) {
# 1559|           x = (l_float32)i / 64.;
# 1560|->         curve[i] = (l_int32)(255. * powf(x, invgamma) + 0.5);
# 1561|       }
# 1562|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def445]
leptonica-1.87.0/src/colormap.c:1560:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘curve’
leptonica-1.87.0/src/colormap.c:1556:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/colormap.c:1558:17: branch_true: following ‘true’ branch (when ‘i != 64’)...
leptonica-1.87.0/src/colormap.c:1559:13: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:1560:9: danger: ‘curve + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 1558|       for (i = 0; i < 64; i++) {
# 1559|           x = (l_float32)i / 64.;
# 1560|->         curve[i] = (l_int32)(255. * powf(x, invgamma) + 0.5);
# 1561|       }
# 1562|   

Error: COMPILER_WARNING: [#def446]
leptonica-1.87.0/src/colormap.c: scope_hint: In function ‘pixcmapReadStream’
leptonica-1.87.0/src/colormap.c:1791:35: warning[-Wunused-but-set-variable=]: variable ‘ignore’ set but not used
# 1791 | l_int32   rval, gval, bval, aval, ignore;
#      |                                   ^~~~~~
# 1789|   pixcmapReadStream(FILE  *fp)
# 1790|   {
# 1791|-> l_int32   rval, gval, bval, aval, ignore;
# 1792|   l_int32   i, index, ret, depth, ncolors;
# 1793|   PIXCMAP  *cmap;

Error: CPPCHECK_WARNING (CWE-476): [#def447]
leptonica-1.87.0/src/colormap.c:2015: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rmap
# 2013|       cta = (RGBA_QUAD *)cmap->array;
# 2014|       for (i = 0; i < ncolors; i++) {
# 2015|->         rmap[i] = cta[i].red;
# 2016|           gmap[i] = cta[i].green;
# 2017|           bmap[i] = cta[i].blue;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def448]
leptonica-1.87.0/src/colormap.c:2015:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rmap’
leptonica-1.87.0/src/colormap.c:1027:1: enter_function: entry to ‘pixcmapHasColor’
leptonica-1.87.0/src/colormap.c:1033:8: branch_false: following ‘false’ branch (when ‘pcolor’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:1035:5: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1036:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:1039:9: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1039:9: call_function: calling ‘pixcmapToArrays’ from ‘pixcmapHasColor’
# 2013|       cta = (RGBA_QUAD *)cmap->array;
# 2014|       for (i = 0; i < ncolors; i++) {
# 2015|->         rmap[i] = cta[i].red;
# 2016|           gmap[i] = cta[i].green;
# 2017|           bmap[i] = cta[i].blue;

Error: CPPCHECK_WARNING (CWE-476): [#def449]
leptonica-1.87.0/src/colormap.c:2016: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gmap
# 2014|       for (i = 0; i < ncolors; i++) {
# 2015|           rmap[i] = cta[i].red;
# 2016|->         gmap[i] = cta[i].green;
# 2017|           bmap[i] = cta[i].blue;
# 2018|           if (pamap)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def450]
leptonica-1.87.0/src/colormap.c:2016:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘gmap’
leptonica-1.87.0/src/colormap.c:1027:1: enter_function: entry to ‘pixcmapHasColor’
leptonica-1.87.0/src/colormap.c:1033:8: branch_false: following ‘false’ branch (when ‘pcolor’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:1035:5: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1036:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:1039:9: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:1039:9: call_function: calling ‘pixcmapToArrays’ from ‘pixcmapHasColor’
# 2014|       for (i = 0; i < ncolors; i++) {
# 2015|           rmap[i] = cta[i].red;
# 2016|->         gmap[i] = cta[i].green;
# 2017|           bmap[i] = cta[i].blue;
# 2018|           if (pamap)

Error: CPPCHECK_WARNING (CWE-476): [#def451]
leptonica-1.87.0/src/colormap.c:2017: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bmap
# 2015|           rmap[i] = cta[i].red;
# 2016|           gmap[i] = cta[i].green;
# 2017|->         bmap[i] = cta[i].blue;
# 2018|           if (pamap)
# 2019|               amap[i] = cta[i].alpha;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def452]
leptonica-1.87.0/src/colormap.c:2017:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘bmap’
leptonica-1.87.0/src/colormap.c:1984:1: enter_function: entry to ‘pixcmapToArrays’
leptonica-1.87.0/src/colormap.c:1998:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:2001:15: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:2001:15: call_function: calling ‘pixcmapGetCount’ from ‘pixcmapToArrays’
leptonica-1.87.0/src/colormap.c:2001:15: return_function: returning to ‘pixcmapToArrays’ from ‘pixcmapGetCount’
leptonica-1.87.0/src/colormap.c:2004:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/colormap.c:2008:8: branch_false: following ‘false’ branch (when ‘pamap’ is NULL)...
leptonica-1.87.0/src/colormap.c:2013:5: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:2014:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colormap.c:2015:22: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:2017:9: danger: ‘bmap + (long unsigned int)i * 4’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
# 2015|           rmap[i] = cta[i].red;
# 2016|           gmap[i] = cta[i].green;
# 2017|->         bmap[i] = cta[i].blue;
# 2018|           if (pamap)
# 2019|               amap[i] = cta[i].alpha;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def453]
leptonica-1.87.0/src/colormap.c:2019:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘amap’
leptonica-1.87.0/src/colormap.c:1984:1: enter_function: entry to ‘pixcmapToArrays’
leptonica-1.87.0/src/colormap.c:1998:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:2001:15: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:2001:15: call_function: calling ‘pixcmapGetCount’ from ‘pixcmapToArrays’
leptonica-1.87.0/src/colormap.c:2001:15: return_function: returning to ‘pixcmapToArrays’ from ‘pixcmapGetCount’
leptonica-1.87.0/src/colormap.c:2008:8: branch_true: following ‘true’ branch (when ‘pamap’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:2009:27: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:2009:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/colormap.c:2014:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colormap.c:2015:22: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:2018:12: branch_true: following ‘true’ branch (when ‘pamap’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:2019:23: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:2019:13: danger: ‘amap + (long unsigned int)i * 4’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/10)
# 2017|           bmap[i] = cta[i].blue;
# 2018|           if (pamap)
# 2019|->             amap[i] = cta[i].alpha;
# 2020|       }
# 2021|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def454]
leptonica-1.87.0/src/colormap.c:2102:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.87.0/src/colormap.c:2076:1: enter_function: entry to ‘pixcmapSerializeToMemory’
leptonica-1.87.0/src/colormap.c:2084:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:2086:5: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:2087:8: branch_false: following ‘false’ branch (when ‘pncolors’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:2089:5: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:2090:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:2092:9: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:2092:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colormap.c:2095:15: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:2095:15: call_function: calling ‘pixcmapGetCount’ from ‘pixcmapSerializeToMemory’
leptonica-1.87.0/src/colormap.c:2095:15: return_function: returning to ‘pixcmapSerializeToMemory’ from ‘pixcmapGetCount’
leptonica-1.87.0/src/colormap.c:2097:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/colormap.c:2100:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colormap.c:2101:9: branch_true: ...to here
leptonica-1.87.0/src/colormap.c:2101:9: call_function: calling ‘pixcmapGetRGBA’ from ‘pixcmapSerializeToMemory’
leptonica-1.87.0/src/colormap.c:2101:9: return_function: returning to ‘pixcmapSerializeToMemory’ from ‘pixcmapGetRGBA’
leptonica-1.87.0/src/colormap.c:2102:9: danger: ‘data + (sizetype)(i * cpc)’ could be NULL: unchecked value from [(15)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/14)
# 2100|       for (i = 0; i < ncolors; i++) {
# 2101|           pixcmapGetRGBA(cmap, i, &rval, &gval, &bval, &aval);
# 2102|->         data[cpc * i] = rval;
# 2103|           data[cpc * i + 1] = gval;
# 2104|           data[cpc * i + 2] = bval;

Error: CPPCHECK_WARNING (CWE-476): [#def455]
leptonica-1.87.0/src/colormap.c:2194: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2192|       hexbytes = 2 + (2 * 3 + 1) * ncolors + 2;
# 2193|       hexdata = (char *)LEPT_CALLOC(hexbytes, sizeof(char));
# 2194|->     hexdata[0] = '<';
# 2195|       hexdata[1] = ' ';
# 2196|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def456]
leptonica-1.87.0/src/colormap.c:2194:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘hexdata’
leptonica-1.87.0/src/colormap.c:2187:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/colormap.c:2189:8: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:2189:8: branch_false: following ‘false’ branch (when ‘ncolors > 0’)...
leptonica-1.87.0/src/colormap.c:2192:20: branch_false: ...to here
leptonica-1.87.0/src/colormap.c:2193:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/colormap.c:2194:5: danger: ‘hexdata’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
# 2192|       hexbytes = 2 + (2 * 3 + 1) * ncolors + 2;
# 2193|       hexdata = (char *)LEPT_CALLOC(hexbytes, sizeof(char));
# 2194|->     hexdata[0] = '<';
# 2195|       hexdata[1] = ' ';
# 2196|   

Error: CPPCHECK_WARNING (CWE-476): [#def457]
leptonica-1.87.0/src/colormap.c:2195: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2193|       hexdata = (char *)LEPT_CALLOC(hexbytes, sizeof(char));
# 2194|       hexdata[0] = '<';
# 2195|->     hexdata[1] = ' ';
# 2196|   
# 2197|       for (i = 0; i < ncolors; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def458]
leptonica-1.87.0/src/colormap.c:2200: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2198|           j = 2 + (2 * 3 + 1) * i;
# 2199|           snprintf(buf, sizeof(buf), "%02x", data[3 * i]);
# 2200|->         hexdata[j] = buf[0];
# 2201|           hexdata[j + 1] = buf[1];
# 2202|           snprintf(buf, sizeof(buf), "%02x", data[3 * i + 1]);

Error: CPPCHECK_WARNING (CWE-476): [#def459]
leptonica-1.87.0/src/colormap.c:2201: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2199|           snprintf(buf, sizeof(buf), "%02x", data[3 * i]);
# 2200|           hexdata[j] = buf[0];
# 2201|->         hexdata[j + 1] = buf[1];
# 2202|           snprintf(buf, sizeof(buf), "%02x", data[3 * i + 1]);
# 2203|           hexdata[j + 2] = buf[0];

Error: CPPCHECK_WARNING (CWE-476): [#def460]
leptonica-1.87.0/src/colormap.c:2203: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2201|           hexdata[j + 1] = buf[1];
# 2202|           snprintf(buf, sizeof(buf), "%02x", data[3 * i + 1]);
# 2203|->         hexdata[j + 2] = buf[0];
# 2204|           hexdata[j + 3] = buf[1];
# 2205|           snprintf(buf, sizeof(buf), "%02x", data[3 * i + 2]);

Error: CPPCHECK_WARNING (CWE-476): [#def461]
leptonica-1.87.0/src/colormap.c:2204: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2202|           snprintf(buf, sizeof(buf), "%02x", data[3 * i + 1]);
# 2203|           hexdata[j + 2] = buf[0];
# 2204|->         hexdata[j + 3] = buf[1];
# 2205|           snprintf(buf, sizeof(buf), "%02x", data[3 * i + 2]);
# 2206|           hexdata[j + 4] = buf[0];

Error: CPPCHECK_WARNING (CWE-476): [#def462]
leptonica-1.87.0/src/colormap.c:2206: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2204|           hexdata[j + 3] = buf[1];
# 2205|           snprintf(buf, sizeof(buf), "%02x", data[3 * i + 2]);
# 2206|->         hexdata[j + 4] = buf[0];
# 2207|           hexdata[j + 5] = buf[1];
# 2208|           hexdata[j + 6] = ' ';

Error: CPPCHECK_WARNING (CWE-476): [#def463]
leptonica-1.87.0/src/colormap.c:2207: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2205|           snprintf(buf, sizeof(buf), "%02x", data[3 * i + 2]);
# 2206|           hexdata[j + 4] = buf[0];
# 2207|->         hexdata[j + 5] = buf[1];
# 2208|           hexdata[j + 6] = ' ';
# 2209|       }

Error: CPPCHECK_WARNING (CWE-476): [#def464]
leptonica-1.87.0/src/colormap.c:2208: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2206|           hexdata[j + 4] = buf[0];
# 2207|           hexdata[j + 5] = buf[1];
# 2208|->         hexdata[j + 6] = ' ';
# 2209|       }
# 2210|       hexdata[j + 7] = '>';

Error: CPPCHECK_WARNING (CWE-476): [#def465]
leptonica-1.87.0/src/colormap.c:2210: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2208|           hexdata[j + 6] = ' ';
# 2209|       }
# 2210|->     hexdata[j + 7] = '>';
# 2211|       hexdata[j + 8] = '\0';
# 2212|       return hexdata;

Error: CPPCHECK_WARNING (CWE-476): [#def466]
leptonica-1.87.0/src/colormap.c:2211: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hexdata
# 2209|       }
# 2210|       hexdata[j + 7] = '>';
# 2211|->     hexdata[j + 8] = '\0';
# 2212|       return hexdata;
# 2213|   }

Error: COMPILER_WARNING (CWE-457): [#def467]
leptonica-1.87.0/src/colorquant1.c:688:5: warning[-Wmaybe-uninitialized]: ‘cmap’ may be used uninitialized
#  688 |     pixcmapGetColor(cmap, index, &rval, &gval, &bval);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/colorquant1.c: scope_hint: In function ‘pixOctreeColorQuantGeneral’
leptonica-1.87.0/src/colorquant1.c:612:12: note: ‘cmap’ was declared here
#  612 | PIXCMAP   *cmap;
#      |            ^~~~
#  686|           /* Force darkest color to black if each component <= 4 */
#  687|       pixcmapGetRankIntensity(cmap, 0.0, &index);
#  688|->     pixcmapGetColor(cmap, index, &rval, &gval, &bval);
#  689|       if (rval < 5 && gval < 5 && bval < 5)
#  690|           pixcmapResetColor(cmap, index, 0, 0, 0);

Error: CPPCHECK_WARNING (CWE-476): [#def468]
leptonica-1.87.0/src/colorquant1.c:1264: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cqcaa
# 1262|           ncells = 1 << (3 * level);
# 1263|           cqca = (CQCELL **)LEPT_CALLOC(ncells, sizeof(CQCELL *));
# 1264|->         cqcaa[level] = cqca;
# 1265|           for (i = 0; i < ncells; i++) {
# 1266|               cqca[i] = (CQCELL *)LEPT_CALLOC(1, sizeof(CQCELL));

Error: CPPCHECK_WARNING (CWE-476): [#def469]
leptonica-1.87.0/src/colorquant1.c:1266: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cqca
# 1264|           cqcaa[level] = cqca;
# 1265|           for (i = 0; i < ncells; i++) {
# 1266|->             cqca[i] = (CQCELL *)LEPT_CALLOC(1, sizeof(CQCELL));
# 1267|           }
# 1268|       }

Error: CPPCHECK_WARNING (CWE-476): [#def470]
leptonica-1.87.0/src/colorquant1.c:1804: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: opop
# 1802|           if (narray[i] > 0) {
# 1803|               opop = (L_OCTCUBE_POP *)LEPT_CALLOC(1, sizeof(L_OCTCUBE_POP));
# 1804|->             opop->npix = (l_float32)narray[i];
# 1805|               opop->index = i;
# 1806|               opop->rval = rarray[i];

Error: CPPCHECK_WARNING (CWE-476): [#def471]
leptonica-1.87.0/src/colorquant1.c:1805: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: opop
# 1803|               opop = (L_OCTCUBE_POP *)LEPT_CALLOC(1, sizeof(L_OCTCUBE_POP));
# 1804|               opop->npix = (l_float32)narray[i];
# 1805|->             opop->index = i;
# 1806|               opop->rval = rarray[i];
# 1807|               opop->gval = garray[i];

Error: CPPCHECK_WARNING (CWE-476): [#def472]
leptonica-1.87.0/src/colorquant1.c:1806: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: opop
# 1804|               opop->npix = (l_float32)narray[i];
# 1805|               opop->index = i;
# 1806|->             opop->rval = rarray[i];
# 1807|               opop->gval = garray[i];
# 1808|               opop->bval = barray[i];

Error: CPPCHECK_WARNING (CWE-476): [#def473]
leptonica-1.87.0/src/colorquant1.c:1807: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: opop
# 1805|               opop->index = i;
# 1806|               opop->rval = rarray[i];
# 1807|->             opop->gval = garray[i];
# 1808|               opop->bval = barray[i];
# 1809|               lheapAdd(lh, opop);

Error: CPPCHECK_WARNING (CWE-476): [#def474]
leptonica-1.87.0/src/colorquant1.c:1808: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: opop
# 1806|               opop->rval = rarray[i];
# 1807|               opop->gval = garray[i];
# 1808|->             opop->bval = barray[i];
# 1809|               lheapAdd(lh, opop);
# 1810|           }

Error: CPPCHECK_WARNING (CWE-476): [#def475]
leptonica-1.87.0/src/colorquant1.c:2376: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2374|       oqca = (OQCELL **)LEPT_CALLOC(ncubes, sizeof(OQCELL *));
# 2375|       for (i = 0; i < ncubes; i++) {
# 2376|->         oqca[i] = (OQCELL *)LEPT_CALLOC(1, sizeof(OQCELL));
# 2377|           oqca[i]->n = 0.0;
# 2378|       }

Error: CPPCHECK_WARNING (CWE-476): [#def476]
leptonica-1.87.0/src/colorquant1.c:2377: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2375|       for (i = 0; i < ncubes; i++) {
# 2376|           oqca[i] = (OQCELL *)LEPT_CALLOC(1, sizeof(OQCELL));
# 2377|->         oqca[i]->n = 0.0;
# 2378|       }
# 2379|   

Error: CPPCHECK_WARNING (CWE-476): [#def477]
leptonica-1.87.0/src/colorquant1.c:2393: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2391|               extractRGBValues(*pspixel, &rval, &gval, &bval);
# 2392|               getOctcubeIndexFromRGB(rval, gval, bval, rtab, gtab, btab, &index);
# 2393|->             oqca[index]->n += 1.0;
# 2394|               oqca[index]->octindex = index;
# 2395|               oqca[index]->rcum += rval;

Error: CPPCHECK_WARNING (CWE-476): [#def478]
leptonica-1.87.0/src/colorquant1.c:2394: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2392|               getOctcubeIndexFromRGB(rval, gval, bval, rtab, gtab, btab, &index);
# 2393|               oqca[index]->n += 1.0;
# 2394|->             oqca[index]->octindex = index;
# 2395|               oqca[index]->rcum += rval;
# 2396|               oqca[index]->gcum += gval;

Error: CPPCHECK_WARNING (CWE-476): [#def479]
leptonica-1.87.0/src/colorquant1.c:2395: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2393|               oqca[index]->n += 1.0;
# 2394|               oqca[index]->octindex = index;
# 2395|->             oqca[index]->rcum += rval;
# 2396|               oqca[index]->gcum += gval;
# 2397|               oqca[index]->bcum += bval;

Error: CPPCHECK_WARNING (CWE-476): [#def480]
leptonica-1.87.0/src/colorquant1.c:2396: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2394|               oqca[index]->octindex = index;
# 2395|               oqca[index]->rcum += rval;
# 2396|->             oqca[index]->gcum += gval;
# 2397|               oqca[index]->bcum += bval;
# 2398|           }

Error: CPPCHECK_WARNING (CWE-476): [#def481]
leptonica-1.87.0/src/colorquant1.c:2397: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2395|               oqca[index]->rcum += rval;
# 2396|               oqca[index]->gcum += gval;
# 2397|->             oqca[index]->bcum += bval;
# 2398|           }
# 2399|       }

Error: CPPCHECK_WARNING (CWE-476): [#def482]
leptonica-1.87.0/src/colorquant1.c:2404: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2402|       lh = lheapCreate(512, L_SORT_DECREASING);
# 2403|       for (i = 0; i < ncubes; i++)
# 2404|->         lheapAdd(lh, oqca[i]);
# 2405|       LEPT_FREE(oqca);  /* don't need this array */
# 2406|   

Error: CPPCHECK_WARNING (CWE-476): [#def483]
leptonica-1.87.0/src/colorquant1.c:2410: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2408|       oqca = (OQCELL **)LEPT_CALLOC(maxcolors, sizeof(OQCELL *));
# 2409|       for (i = 0; i < nbase; i++) {  /* make nbase cells */
# 2410|->         oqca[i] = (OQCELL *)LEPT_CALLOC(1, sizeof(OQCELL));
# 2411|           oqca[i]->n = 0.0;
# 2412|       }

Error: CPPCHECK_WARNING (CWE-476): [#def484]
leptonica-1.87.0/src/colorquant1.c:2411: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2409|       for (i = 0; i < nbase; i++) {  /* make nbase cells */
# 2410|           oqca[i] = (OQCELL *)LEPT_CALLOC(1, sizeof(OQCELL));
# 2411|->         oqca[i]->n = 0.0;
# 2412|       }
# 2413|   

Error: CPPCHECK_WARNING (CWE-476): [#def485]
leptonica-1.87.0/src/colorquant1.c:2421: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2419|           oqc->gcum = 0;
# 2420|           oqc->bcum = 0;
# 2421|->         oqca[nbase + i] = oqc;  /* store it in the array */
# 2422|       }
# 2423|   

Error: CPPCHECK_WARNING (CWE-476): [#def486]
leptonica-1.87.0/src/colorquant1.c:2431: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lut1
# 2429|       lut1 = (l_int32 *)LEPT_CALLOC(ncubes, sizeof(l_int32));
# 2430|       for (i = 0; i < nextra; i++)
# 2431|->         lut1[oqca[nbase + i]->octindex] = nbase + i;
# 2432|       for (index = 0; index < ncubes; index++) {
# 2433|           if (lut1[index] == 0)  /* not one of the extras; need to assign */

Error: CPPCHECK_WARNING (CWE-476): [#def487]
leptonica-1.87.0/src/colorquant1.c:2431: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: oqca
# 2429|       lut1 = (l_int32 *)LEPT_CALLOC(ncubes, sizeof(l_int32));
# 2430|       for (i = 0; i < nextra; i++)
# 2431|->         lut1[oqca[nbase + i]->octindex] = nbase + i;
# 2432|       for (index = 0; index < ncubes; index++) {
# 2433|           if (lut1[index] == 0)  /* not one of the extras; need to assign */

Error: CPPCHECK_WARNING (CWE-476): [#def488]
leptonica-1.87.0/src/colorquant1.c:2433: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lut1
# 2431|           lut1[oqca[nbase + i]->octindex] = nbase + i;
# 2432|       for (index = 0; index < ncubes; index++) {
# 2433|->         if (lut1[index] == 0)  /* not one of the extras; need to assign */
# 2434|               lut1[index] = index >> 3;  /* remove the least significant bits */
# 2435|   /*        lept_stderr("lut1[%d] = %d\n", index, lut1[index]); */

Error: CPPCHECK_WARNING (CWE-476): [#def489]
leptonica-1.87.0/src/colorquant1.c:2479: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lut2
# 2477|       for (i = 0, index = 0; i < maxcolors; i++) {
# 2478|           oqc = oqca[i];
# 2479|->         lut2[i] = index;
# 2480|           if (oqc->n == 0)  /* no occupancy; don't bump up index */
# 2481|               continue;

Error: CPPCHECK_WARNING (CWE-476): [#def490]
leptonica-1.87.0/src/colorquant1.c:3305: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lut
# 3303|       lut = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
# 3304|       for (i = 0; i < 256; i++)
# 3305|->         lut[i] = -1;
# 3306|       for (i = 0, index = 0; i < ncolors; i++) {
# 3307|           pixcmapGetColor(cmap, i, &rval, &gval, &bval);

Error: COMPILER_WARNING (CWE-457): [#def491]
leptonica-1.87.0/src/colorquant1.c:3715:15: warning[-Wmaybe-uninitialized]: ‘size’ may be used uninitialized
# 3715 |     if ((na = numaCreate(size)) == NULL) {
#      |               ^~~~~~~~~~~~~~~~
leptonica-1.87.0/src/colorquant1.c: scope_hint: In function ‘pixOctcubeHistogram’
leptonica-1.87.0/src/colorquant1.c:3692:13: note: ‘size’ was declared here
# 3692 | l_int32     size, i, j, w, h, wpl, ncolors, val;
#      |             ^~~~
# 3713|       makeRGBToIndexTables(level, &rtab, &gtab, &btab);
# 3714|   
# 3715|->     if ((na = numaCreate(size)) == NULL) {
# 3716|           L_ERROR("na not made\n", __func__);
# 3717|           goto cleanup_arrays;

Error: CPPCHECK_WARNING (CWE-476): [#def492]
leptonica-1.87.0/src/colorquant1.c:3971: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: map1
# 3969|       cmapd = pixcmapCreate(d);
# 3970|       for (i = 0; i < index; i++) {
# 3971|->         pixcmapGetColor(cmap, map1[i], &rval, &gval, &bval);
# 3972|           pixcmapAddColor(cmapd, rval, gval, bval);
# 3973|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def493]
leptonica-1.87.0/src/colorquant2.c:384:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.87.0/src/colorquant2.c:260:1: enter_function: entry to ‘pixMedianCutQuant’
leptonica-1.87.0/src/colorquant2.c:263:12: call_function: calling ‘pixMedianCutQuantGeneral’ from ‘pixMedianCutQuant’
#  382|       smalln = TRUE;
#  383|       for (i = 0; i < histosize; i++) {
#  384|->         if (histo[i])
#  385|               ncolors++;
#  386|           if (ncolors > maxcolors) {

Error: CPPCHECK_WARNING (CWE-476): [#def494]
leptonica-1.87.0/src/colorquant2.c:651: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lut
#  649|       lut = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  650|       for (i = 0; i < 256; i++)
#  651|->         lut[i] = ncolor + 1 + (i * (ngray - 1) + 128) / 255;
#  652|       for (i = 0; i < h; i++) {
#  653|           linec = datac + i * wplc;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def495]
leptonica-1.87.0/src/colorquant2.c:651:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lut’
leptonica-1.87.0/src/colorquant2.c:612:8: branch_false: following ‘false’ branch (when ‘ngray > 1’)...
leptonica-1.87.0/src/colorquant2.c:614:9: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:614:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:616:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:629:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:643:12: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:649:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/colorquant2.c:650:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/colorquant2.c:651:18: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:651:9: danger: ‘lut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  649|       lut = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  650|       for (i = 0; i < 256; i++)
#  651|->         lut[i] = ncolor + 1 + (i * (ngray - 1) + 128) / 255;
#  652|       for (i = 0; i < h; i++) {
#  653|           linec = datac + i * wplc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def496]
leptonica-1.87.0/src/colorquant2.c:861:5: warning[-Wanalyzer-malloc-leak]: leak of ‘histo’
leptonica-1.87.0/src/colorquant2.c:848:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:850:9: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:852:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:852:8: branch_false: following ‘false’ branch (when ‘subsample > 0’)...
leptonica-1.87.0/src/colorquant2.c:855:22: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:856:29: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:856:8: branch_false: following ‘false’ branch (when ‘histo’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:859:5: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:861:5: throw: if ‘pixGetDimensions’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:861:5: danger: ‘histo’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  859|       rshift = 8 - sigbits;
#  860|       mask = 0xff >> rshift;
#  861|->     pixGetDimensions(pixs, &w, &h, NULL);
#  862|       data = pixGetData(pixs);
#  863|       wpl = pixGetWpl(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def497]
leptonica-1.87.0/src/colorquant2.c:862:12: warning[-Wanalyzer-malloc-leak]: leak of ‘histo’
leptonica-1.87.0/src/colorquant2.c:848:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:850:9: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:852:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:852:8: branch_false: following ‘false’ branch (when ‘subsample > 0’)...
leptonica-1.87.0/src/colorquant2.c:855:22: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:856:29: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:856:8: branch_false: following ‘false’ branch (when ‘histo’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:859:5: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:862:12: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:862:12: danger: ‘histo’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  860|       mask = 0xff >> rshift;
#  861|       pixGetDimensions(pixs, &w, &h, NULL);
#  862|->     data = pixGetData(pixs);
#  863|       wpl = pixGetWpl(pixs);
#  864|       for (i = 0; i < h; i += subsample) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def498]
leptonica-1.87.0/src/colorquant2.c:863:11: warning[-Wanalyzer-malloc-leak]: leak of ‘histo’
leptonica-1.87.0/src/colorquant2.c:848:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:850:9: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:850:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:852:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:852:8: branch_false: following ‘false’ branch (when ‘subsample > 0’)...
leptonica-1.87.0/src/colorquant2.c:855:22: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:856:29: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:856:8: branch_false: following ‘false’ branch (when ‘histo’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:859:5: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:863:11: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:863:11: danger: ‘histo’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  861|       pixGetDimensions(pixs, &w, &h, NULL);
#  862|       data = pixGetData(pixs);
#  863|->     wpl = pixGetWpl(pixs);
#  864|       for (i = 0; i < h; i += subsample) {
#  865|           line = data + i * wpl;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def499]
leptonica-1.87.0/src/colorquant2.c:1044:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1b’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1038:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1044:13: danger: ‘buf1b’ leaks here; was allocated at [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6)
# 1042|           if (!bufu8r || !bufu8g || !bufu8b || !buf1r || !buf1g ||
# 1043|               !buf1b || !buf2r || !buf2g || !buf2b) {
# 1044|->             L_ERROR("buffer not made\n", __func__);
# 1045|               success = FALSE;
# 1046|               goto buffer_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def500]
leptonica-1.87.0/src/colorquant2.c:1044:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1g’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1037:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1044:13: danger: ‘buf1g’ leaks here; was allocated at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
# 1042|           if (!bufu8r || !bufu8g || !bufu8b || !buf1r || !buf1g ||
# 1043|               !buf1b || !buf2r || !buf2g || !buf2b) {
# 1044|->             L_ERROR("buffer not made\n", __func__);
# 1045|               success = FALSE;
# 1046|               goto buffer_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def501]
leptonica-1.87.0/src/colorquant2.c:1044:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1r’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1036:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1044:13: danger: ‘buf1r’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
# 1042|           if (!bufu8r || !bufu8g || !bufu8b || !buf1r || !buf1g ||
# 1043|               !buf1b || !buf2r || !buf2g || !buf2b) {
# 1044|->             L_ERROR("buffer not made\n", __func__);
# 1045|               success = FALSE;
# 1046|               goto buffer_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def502]
leptonica-1.87.0/src/colorquant2.c:1044:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2b’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1041:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1044:13: danger: ‘buf2b’ leaks here; was allocated at [(7)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/6)
# 1042|           if (!bufu8r || !bufu8g || !bufu8b || !buf1r || !buf1g ||
# 1043|               !buf1b || !buf2r || !buf2g || !buf2b) {
# 1044|->             L_ERROR("buffer not made\n", __func__);
# 1045|               success = FALSE;
# 1046|               goto buffer_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def503]
leptonica-1.87.0/src/colorquant2.c:1044:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2g’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1040:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1044:13: danger: ‘buf2g’ leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
# 1042|           if (!bufu8r || !bufu8g || !bufu8b || !buf1r || !buf1g ||
# 1043|               !buf1b || !buf2r || !buf2g || !buf2b) {
# 1044|->             L_ERROR("buffer not made\n", __func__);
# 1045|               success = FALSE;
# 1046|               goto buffer_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def504]
leptonica-1.87.0/src/colorquant2.c:1044:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2r’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1039:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1044:13: danger: ‘buf2r’ leaks here; was allocated at [(7)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/6)
# 1042|           if (!bufu8r || !bufu8g || !bufu8b || !buf1r || !buf1g ||
# 1043|               !buf1b || !buf2r || !buf2g || !buf2b) {
# 1044|->             L_ERROR("buffer not made\n", __func__);
# 1045|               success = FALSE;
# 1046|               goto buffer_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def505]
leptonica-1.87.0/src/colorquant2.c:1044:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bufu8b’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1035:29: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1044:13: danger: ‘bufu8b’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
# 1042|           if (!bufu8r || !bufu8g || !bufu8b || !buf1r || !buf1g ||
# 1043|               !buf1b || !buf2r || !buf2g || !buf2b) {
# 1044|->             L_ERROR("buffer not made\n", __func__);
# 1045|               success = FALSE;
# 1046|               goto buffer_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def506]
leptonica-1.87.0/src/colorquant2.c:1044:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bufu8g’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1034:29: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1044:13: danger: ‘bufu8g’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
# 1042|           if (!bufu8r || !bufu8g || !bufu8b || !buf1r || !buf1g ||
# 1043|               !buf1b || !buf2r || !buf2g || !buf2b) {
# 1044|->             L_ERROR("buffer not made\n", __func__);
# 1045|               success = FALSE;
# 1046|               goto buffer_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def507]
leptonica-1.87.0/src/colorquant2.c:1044:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bufu8r’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1033:29: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1044:13: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1044:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1044:13: danger: ‘bufu8r’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
# 1042|           if (!bufu8r || !bufu8g || !bufu8b || !buf1r || !buf1g ||
# 1043|               !buf1b || !buf2r || !buf2g || !buf2b) {
# 1044|->             L_ERROR("buffer not made\n", __func__);
# 1045|               success = FALSE;
# 1046|               goto buffer_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def508]
leptonica-1.87.0/src/colorquant2.c:1050:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1b’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1038:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1043:23: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1050:9: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1050:9: danger: ‘buf1b’ leaks here; was allocated at [(7)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/6)
# 1048|   
# 1049|               /* Start by priming buf2; line 1 is above line 2 */
# 1050|->         pixGetRGBLine(pixs, 0, bufu8r, bufu8g, bufu8b);
# 1051|           for (j = 0; j < w; j++) {
# 1052|               buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def509]
leptonica-1.87.0/src/colorquant2.c:1050:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1g’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1037:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1043:23: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1050:9: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1050:9: danger: ‘buf1g’ leaks here; was allocated at [(7)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/6)
# 1048|   
# 1049|               /* Start by priming buf2; line 1 is above line 2 */
# 1050|->         pixGetRGBLine(pixs, 0, bufu8r, bufu8g, bufu8b);
# 1051|           for (j = 0; j < w; j++) {
# 1052|               buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def510]
leptonica-1.87.0/src/colorquant2.c:1050:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1r’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1036:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:35: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1050:9: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1050:9: danger: ‘buf1r’ leaks here; was allocated at [(7)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/6)
# 1048|   
# 1049|               /* Start by priming buf2; line 1 is above line 2 */
# 1050|->         pixGetRGBLine(pixs, 0, bufu8r, bufu8g, bufu8b);
# 1051|           for (j = 0; j < w; j++) {
# 1052|               buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def511]
leptonica-1.87.0/src/colorquant2.c:1050:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2b’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1041:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch (when ‘buf2b’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:1050:9: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1050:9: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1050:9: danger: ‘buf2b’ leaks here; was allocated at [(7)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/6)
# 1048|   
# 1049|               /* Start by priming buf2; line 1 is above line 2 */
# 1050|->         pixGetRGBLine(pixs, 0, bufu8r, bufu8g, bufu8b);
# 1051|           for (j = 0; j < w; j++) {
# 1052|               buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def512]
leptonica-1.87.0/src/colorquant2.c:1050:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2g’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1040:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1050:9: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1050:9: danger: ‘buf2g’ leaks here; was allocated at [(7)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/6)
# 1048|   
# 1049|               /* Start by priming buf2; line 1 is above line 2 */
# 1050|->         pixGetRGBLine(pixs, 0, bufu8r, bufu8g, bufu8b);
# 1051|           for (j = 0; j < w; j++) {
# 1052|               buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def513]
leptonica-1.87.0/src/colorquant2.c:1050:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2r’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1039:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1050:9: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1050:9: danger: ‘buf2r’ leaks here; was allocated at [(7)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/6)
# 1048|   
# 1049|               /* Start by priming buf2; line 1 is above line 2 */
# 1050|->         pixGetRGBLine(pixs, 0, bufu8r, bufu8g, bufu8b);
# 1051|           for (j = 0; j < w; j++) {
# 1052|               buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def514]
leptonica-1.87.0/src/colorquant2.c:1050:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufu8b’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1035:29: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:35: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1050:9: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1050:9: danger: ‘bufu8b’ leaks here; was allocated at [(7)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/6)
# 1048|   
# 1049|               /* Start by priming buf2; line 1 is above line 2 */
# 1050|->         pixGetRGBLine(pixs, 0, bufu8r, bufu8g, bufu8b);
# 1051|           for (j = 0; j < w; j++) {
# 1052|               buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def515]
leptonica-1.87.0/src/colorquant2.c:1050:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufu8g’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1034:29: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1050:9: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1050:9: danger: ‘bufu8g’ leaks here; was allocated at [(7)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/6)
# 1048|   
# 1049|               /* Start by priming buf2; line 1 is above line 2 */
# 1050|->         pixGetRGBLine(pixs, 0, bufu8r, bufu8g, bufu8b);
# 1051|           for (j = 0; j < w; j++) {
# 1052|               buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def516]
leptonica-1.87.0/src/colorquant2.c:1050:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufu8r’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1033:29: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1050:9: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1050:9: danger: ‘bufu8r’ leaks here; was allocated at [(7)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/6)
# 1048|   
# 1049|               /* Start by priming buf2; line 1 is above line 2 */
# 1050|->         pixGetRGBLine(pixs, 0, bufu8r, bufu8g, bufu8b);
# 1051|           for (j = 0; j < w; j++) {
# 1052|               buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def517]
leptonica-1.87.0/src/colorquant2.c:1062:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1b’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1038:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1043:23: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1062:13: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1062:13: danger: ‘buf1b’ leaks here; was allocated at [(7)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/6)
# 1060|               memcpy(buf1g, buf2g, 4 * w);
# 1061|               memcpy(buf1b, buf2b, 4 * w);
# 1062|->             pixGetRGBLine(pixs, i + 1, bufu8r, bufu8g, bufu8b);
# 1063|               for (j = 0; j < w; j++) {
# 1064|                   buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def518]
leptonica-1.87.0/src/colorquant2.c:1062:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1g’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1037:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1043:23: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1062:13: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1062:13: danger: ‘buf1g’ leaks here; was allocated at [(7)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/6)
# 1060|               memcpy(buf1g, buf2g, 4 * w);
# 1061|               memcpy(buf1b, buf2b, 4 * w);
# 1062|->             pixGetRGBLine(pixs, i + 1, bufu8r, bufu8g, bufu8b);
# 1063|               for (j = 0; j < w; j++) {
# 1064|                   buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def519]
leptonica-1.87.0/src/colorquant2.c:1062:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1r’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1036:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:35: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1062:13: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1062:13: danger: ‘buf1r’ leaks here; was allocated at [(7)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/6)
# 1060|               memcpy(buf1g, buf2g, 4 * w);
# 1061|               memcpy(buf1b, buf2b, 4 * w);
# 1062|->             pixGetRGBLine(pixs, i + 1, bufu8r, bufu8g, bufu8b);
# 1063|               for (j = 0; j < w; j++) {
# 1064|                   buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def520]
leptonica-1.87.0/src/colorquant2.c:1062:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2b’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1041:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch (when ‘buf2b’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:1050:9: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1062:13: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1062:13: danger: ‘buf2b’ leaks here; was allocated at [(7)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/6)
# 1060|               memcpy(buf1g, buf2g, 4 * w);
# 1061|               memcpy(buf1b, buf2b, 4 * w);
# 1062|->             pixGetRGBLine(pixs, i + 1, bufu8r, bufu8g, bufu8b);
# 1063|               for (j = 0; j < w; j++) {
# 1064|                   buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def521]
leptonica-1.87.0/src/colorquant2.c:1062:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2g’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1040:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1062:13: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1062:13: danger: ‘buf2g’ leaks here; was allocated at [(7)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/6)
# 1060|               memcpy(buf1g, buf2g, 4 * w);
# 1061|               memcpy(buf1b, buf2b, 4 * w);
# 1062|->             pixGetRGBLine(pixs, i + 1, bufu8r, bufu8g, bufu8b);
# 1063|               for (j = 0; j < w; j++) {
# 1064|                   buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def522]
leptonica-1.87.0/src/colorquant2.c:1062:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2r’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1039:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1051:21: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1062:13: throw: if ‘pixGetRGBLine’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1062:13: danger: ‘buf2r’ leaks here; was allocated at [(7)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/6)
# 1060|               memcpy(buf1g, buf2g, 4 * w);
# 1061|               memcpy(buf1b, buf2b, 4 * w);
# 1062|->             pixGetRGBLine(pixs, i + 1, bufu8r, bufu8g, bufu8b);
# 1063|               for (j = 0; j < w; j++) {
# 1064|                   buf2r[j] = 64 * bufu8r[j];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def523]
leptonica-1.87.0/src/colorquant2.c:1079:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1b’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1038:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1043:23: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1079:17: throw: if ‘pixcmapGetColor’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1079:17: danger: ‘buf1b’ leaks here; was allocated at [(7)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/6)
# 1077|                   cmapindex = indexmap[index];
# 1078|                   SET_DATA_BYTE(lined, j, cmapindex);
# 1079|->                 pixcmapGetColor(cmap, cmapindex, &rc, &gc, &bc);
# 1080|   
# 1081|                   dif = buf1r[j] / 8 - 8 * rc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def524]
leptonica-1.87.0/src/colorquant2.c:1079:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1g’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1037:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1043:23: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1079:17: throw: if ‘pixcmapGetColor’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1079:17: danger: ‘buf1g’ leaks here; was allocated at [(7)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/6)
# 1077|                   cmapindex = indexmap[index];
# 1078|                   SET_DATA_BYTE(lined, j, cmapindex);
# 1079|->                 pixcmapGetColor(cmap, cmapindex, &rc, &gc, &bc);
# 1080|   
# 1081|                   dif = buf1r[j] / 8 - 8 * rc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def525]
leptonica-1.87.0/src/colorquant2.c:1079:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf1r’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1036:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:35: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1079:17: throw: if ‘pixcmapGetColor’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1079:17: danger: ‘buf1r’ leaks here; was allocated at [(7)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/6)
# 1077|                   cmapindex = indexmap[index];
# 1078|                   SET_DATA_BYTE(lined, j, cmapindex);
# 1079|->                 pixcmapGetColor(cmap, cmapindex, &rc, &gc, &bc);
# 1080|   
# 1081|                   dif = buf1r[j] / 8 - 8 * rc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def526]
leptonica-1.87.0/src/colorquant2.c:1079:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2b’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1041:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch (when ‘buf2b’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:1050:9: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1079:17: throw: if ‘pixcmapGetColor’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1079:17: danger: ‘buf2b’ leaks here; was allocated at [(7)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/6)
# 1077|                   cmapindex = indexmap[index];
# 1078|                   SET_DATA_BYTE(lined, j, cmapindex);
# 1079|->                 pixcmapGetColor(cmap, cmapindex, &rc, &gc, &bc);
# 1080|   
# 1081|                   dif = buf1r[j] / 8 - 8 * rc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def527]
leptonica-1.87.0/src/colorquant2.c:1079:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2g’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1040:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1079:17: throw: if ‘pixcmapGetColor’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1079:17: danger: ‘buf2g’ leaks here; was allocated at [(7)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/6)
# 1077|                   cmapindex = indexmap[index];
# 1078|                   SET_DATA_BYTE(lined, j, cmapindex);
# 1079|->                 pixcmapGetColor(cmap, cmapindex, &rc, &gc, &bc);
# 1080|   
# 1081|                   dif = buf1r[j] / 8 - 8 * rc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def528]
leptonica-1.87.0/src/colorquant2.c:1079:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf2r’
leptonica-1.87.0/src/colorquant2.c:975:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:977:8: branch_false: following ‘false’ branch (when ‘indexmap’ is non-NULL)...
leptonica-1.87.0/src/colorquant2.c:979:8: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:994:8: branch_false: following ‘false’ branch (when ‘ditherflag != 0’)...
leptonica-1.87.0/src/colorquant2.c:1033:29: branch_false: ...to here
leptonica-1.87.0/src/colorquant2.c:1039:28: acquire_memory: allocated here
leptonica-1.87.0/src/colorquant2.c:1042:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1042:13: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorquant2.c:1057:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorquant2.c:1059:34: branch_true: ...to here
leptonica-1.87.0/src/colorquant2.c:1079:17: throw: if ‘pixcmapGetColor’ throws an exception...
leptonica-1.87.0/src/colorquant2.c:1079:17: danger: ‘buf2r’ leaks here; was allocated at [(7)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/6)
# 1077|                   cmapindex = indexmap[index];
# 1078|                   SET_DATA_BYTE(lined, j, cmapindex);
# 1079|->                 pixcmapGetColor(cmap, cmapindex, &rc, &gc, &bc);
# 1080|   
# 1081|                   dif = buf1r[j] / 8 - 8 * rc;

Error: CPPCHECK_WARNING (CWE-476): [#def529]
leptonica-1.87.0/src/colorquant2.c:1632: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vbox
# 1630|   
# 1631|       vbox = (L_BOX3D *)LEPT_CALLOC(1, sizeof(L_BOX3D));
# 1632|->     vbox->r1 = r1;
# 1633|       vbox->r2 = r2;
# 1634|       vbox->g1 = g1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def530]
leptonica-1.87.0/src/colorquant2.c:1632:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘vbox’
leptonica-1.87.0/src/colorquant2.c:1654:1: enter_function: entry to ‘box3dCopy’
leptonica-1.87.0/src/colorquant2.c:1661:13: call_function: inlined call to ‘box3dCreate’ from ‘box3dCopy’
# 1630|   
# 1631|       vbox = (L_BOX3D *)LEPT_CALLOC(1, sizeof(L_BOX3D));
# 1632|->     vbox->r1 = r1;
# 1633|       vbox->r2 = r2;
# 1634|       vbox->g1 = g1;

Error: CPPCHECK_WARNING (CWE-476): [#def531]
leptonica-1.87.0/src/colorquant2.c:1633: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vbox
# 1631|       vbox = (L_BOX3D *)LEPT_CALLOC(1, sizeof(L_BOX3D));
# 1632|       vbox->r1 = r1;
# 1633|->     vbox->r2 = r2;
# 1634|       vbox->g1 = g1;
# 1635|       vbox->g2 = g2;

Error: CPPCHECK_WARNING (CWE-476): [#def532]
leptonica-1.87.0/src/colorquant2.c:1634: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vbox
# 1632|       vbox->r1 = r1;
# 1633|       vbox->r2 = r2;
# 1634|->     vbox->g1 = g1;
# 1635|       vbox->g2 = g2;
# 1636|       vbox->b1 = b1;

Error: CPPCHECK_WARNING (CWE-476): [#def533]
leptonica-1.87.0/src/colorquant2.c:1635: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vbox
# 1633|       vbox->r2 = r2;
# 1634|       vbox->g1 = g1;
# 1635|->     vbox->g2 = g2;
# 1636|       vbox->b1 = b1;
# 1637|       vbox->b2 = b2;

Error: CPPCHECK_WARNING (CWE-476): [#def534]
leptonica-1.87.0/src/colorquant2.c:1636: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vbox
# 1634|       vbox->g1 = g1;
# 1635|       vbox->g2 = g2;
# 1636|->     vbox->b1 = b1;
# 1637|       vbox->b2 = b2;
# 1638|       return vbox;

Error: CPPCHECK_WARNING (CWE-476): [#def535]
leptonica-1.87.0/src/colorquant2.c:1637: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vbox
# 1635|       vbox->g2 = g2;
# 1636|       vbox->b1 = b1;
# 1637|->     vbox->b2 = b2;
# 1638|       return vbox;
# 1639|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def536]
leptonica-1.87.0/src/colorseg.c:320:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘countarray[k]’
leptonica-1.87.0/src/colorseg.c:283:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/colorseg.c:285:8: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:285:8: branch_false: following ‘false’ branch (when ‘pixd’ is non-NULL)...
leptonica-1.87.0/src/colorseg.c:288:9: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:293:17: branch_true: following ‘true’ branch (when ‘k != 256’)...
leptonica-1.87.0/src/colorseg.c:294:29: branch_true: ...to here
leptonica-1.87.0/src/colorseg.c:303:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorseg.c:304:25: branch_true: ...to here
leptonica-1.87.0/src/colorseg.c:306:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorseg.c:307:28: branch_true: ...to here
leptonica-1.87.0/src/colorseg.c:313:25: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorseg.c:314:33: branch_true: ...to here
leptonica-1.87.0/src/colorseg.c:317:20: branch_true: following ‘true’ branch (when ‘maxdist2 >= dist2’)...
leptonica-1.87.0/src/colorseg.c:319:21: branch_true: ...to here
leptonica-1.87.0/src/colorseg.c:320:21: danger: use of uninitialized value ‘countarray[k]’ here
#  318|                       found = TRUE;
#  319|                       SET_DATA_BYTE(lined, j, k);
#  320|->                     countarray[k]++;
#  321|                       rsum[k] += rval;
#  322|                       gsum[k] += gval;

Error: COMPILER_WARNING (CWE-457): [#def537]
leptonica-1.87.0/src/colorseg.c: scope_hint: In function ‘pixAssignToNearestColor’
leptonica-1.87.0/src/colorseg.c:413:30: warning[-Wmaybe-uninitialized]: ‘wplm’ may be used uninitialized
#  413 | l_int32    w, h, wpls, wpld, wplm, i, j, success;
#      |                              ^~~~
#  411|                           l_int32  *countarray)
#  412|   {
#  413|-> l_int32    w, h, wpls, wpld, wplm, i, j, success;
#  414|   l_int32    rval, gval, bval, index;
#  415|   l_int32   *cmaptab;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def538]
leptonica-1.87.0/src/colorseg.c:613:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tab’
leptonica-1.87.0/src/colorseg.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorseg.c:590:17: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:590:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorseg.c:592:8: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:592:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/colorseg.c:594:15: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:595:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorseg.c:604:10: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:605:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorseg.c:609:25: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:611:22: acquire_memory: allocated here
leptonica-1.87.0/src/colorseg.c:612:27: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorseg.c:613:9: branch_true: ...to here
leptonica-1.87.0/src/colorseg.c:613:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/colorseg.c:613:9: danger: ‘tab’ leaks here; was allocated at [(11)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/10)
#  611|       tab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  612|       for (i = finalcolors; i < ncolors; i++) {
#  613|->         numaGetIValue(nasi, i, &index);
#  614|           tab[index] = 1;
#  615|       }

Error: CPPCHECK_WARNING (CWE-476): [#def539]
leptonica-1.87.0/src/colorseg.c:614: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
#  612|       for (i = finalcolors; i < ncolors; i++) {
#  613|           numaGetIValue(nasi, i, &index);
#  614|->         tab[index] = 1;
#  615|       }
#  616|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def540]
leptonica-1.87.0/src/colorseg.c:617:12: warning[-Wanalyzer-malloc-leak]: leak of ‘tab’
leptonica-1.87.0/src/colorseg.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorseg.c:590:17: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:590:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorseg.c:592:8: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:592:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/colorseg.c:594:15: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:595:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorseg.c:604:10: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:605:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorseg.c:609:25: branch_false: ...to here
leptonica-1.87.0/src/colorseg.c:611:22: acquire_memory: allocated here
leptonica-1.87.0/src/colorseg.c:612:27: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/colorseg.c:613:9: branch_true: ...to here
leptonica-1.87.0/src/colorseg.c:617:12: throw: if ‘pixMakeMaskFromLUT’ throws an exception...
leptonica-1.87.0/src/colorseg.c:617:12: danger: ‘tab’ leaks here; was allocated at [(11)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/10)
#  615|       }
#  616|   
#  617|->     pixm = pixMakeMaskFromLUT(pixd, tab);
#  618|       LEPT_FREE(tab);
#  619|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def541]
leptonica-1.87.0/src/colorspace.c:154:9: warning[-Wanalyzer-malloc-leak]: leak of ‘hlut’
leptonica-1.87.0/src/colorspace.c:789:1: enter_function: entry to ‘pixMakeRangeMaskHV’
leptonica-1.87.0/src/colorspace.c:802:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:804:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:809:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:809:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:813:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:815:15: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: following ‘false’ branch (when ‘hstart >= hend’)...
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: following ‘false’ branch (when ‘i == 240’)...
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:823:21: branch_false: following ‘false’ branch (when ‘i > hend’)...
leptonica-1.87.0/src/colorspace.c:828:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:828:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskHV’
#  152|           return (PIX *)ERROR_PTR("pixd defined and not inplace", __func__, pixd);
#  153|   
#  154|->     d = pixGetDepth(pixs);
#  155|       cmap = pixGetColormap(pixs);
#  156|       if (!cmap && d != 32)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def542]
leptonica-1.87.0/src/colorspace.c:154:9: warning[-Wanalyzer-malloc-leak]: leak of ‘slut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:906:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  152|           return (PIX *)ERROR_PTR("pixd defined and not inplace", __func__, pixd);
#  153|   
#  154|->     d = pixGetDepth(pixs);
#  155|       cmap = pixGetColormap(pixs);
#  156|       if (!cmap && d != 32)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def543]
leptonica-1.87.0/src/colorspace.c:154:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vlut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:907:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  152|           return (PIX *)ERROR_PTR("pixd defined and not inplace", __func__, pixd);
#  153|   
#  154|->     d = pixGetDepth(pixs);
#  155|       cmap = pixGetColormap(pixs);
#  156|       if (!cmap && d != 32)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def544]
leptonica-1.87.0/src/colorspace.c:155:12: warning[-Wanalyzer-malloc-leak]: leak of ‘hlut’
leptonica-1.87.0/src/colorspace.c:789:1: enter_function: entry to ‘pixMakeRangeMaskHV’
leptonica-1.87.0/src/colorspace.c:802:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:804:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:809:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:809:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:813:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:815:15: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: following ‘false’ branch (when ‘hstart >= hend’)...
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: following ‘false’ branch (when ‘i == 240’)...
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:823:21: branch_false: following ‘false’ branch (when ‘i > hend’)...
leptonica-1.87.0/src/colorspace.c:828:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:828:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskHV’
#  153|   
#  154|       d = pixGetDepth(pixs);
#  155|->     cmap = pixGetColormap(pixs);
#  156|       if (!cmap && d != 32)
#  157|           return (PIX *)ERROR_PTR("not cmapped or rgb", __func__, pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def545]
leptonica-1.87.0/src/colorspace.c:155:12: warning[-Wanalyzer-malloc-leak]: leak of ‘slut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:906:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  153|   
#  154|       d = pixGetDepth(pixs);
#  155|->     cmap = pixGetColormap(pixs);
#  156|       if (!cmap && d != 32)
#  157|           return (PIX *)ERROR_PTR("not cmapped or rgb", __func__, pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def546]
leptonica-1.87.0/src/colorspace.c:155:12: warning[-Wanalyzer-malloc-leak]: leak of ‘vlut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:907:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  153|   
#  154|       d = pixGetDepth(pixs);
#  155|->     cmap = pixGetColormap(pixs);
#  156|       if (!cmap && d != 32)
#  157|           return (PIX *)ERROR_PTR("not cmapped or rgb", __func__, pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def547]
leptonica-1.87.0/src/colorspace.c:157:23: warning[-Wanalyzer-malloc-leak]: leak of ‘hlut’
leptonica-1.87.0/src/colorspace.c:789:1: enter_function: entry to ‘pixMakeRangeMaskHV’
leptonica-1.87.0/src/colorspace.c:802:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:804:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:809:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:809:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:813:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:815:15: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: following ‘false’ branch (when ‘hstart >= hend’)...
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: following ‘false’ branch (when ‘i == 240’)...
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:823:21: branch_false: following ‘false’ branch (when ‘i > hend’)...
leptonica-1.87.0/src/colorspace.c:828:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:828:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskHV’
#  155|       cmap = pixGetColormap(pixs);
#  156|       if (!cmap && d != 32)
#  157|->         return (PIX *)ERROR_PTR("not cmapped or rgb", __func__, pixd);
#  158|   
#  159|       if (!pixd)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def548]
leptonica-1.87.0/src/colorspace.c:157:23: warning[-Wanalyzer-malloc-leak]: leak of ‘slut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:906:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  155|       cmap = pixGetColormap(pixs);
#  156|       if (!cmap && d != 32)
#  157|->         return (PIX *)ERROR_PTR("not cmapped or rgb", __func__, pixd);
#  158|   
#  159|       if (!pixd)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def549]
leptonica-1.87.0/src/colorspace.c:157:23: warning[-Wanalyzer-malloc-leak]: leak of ‘vlut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:907:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  155|       cmap = pixGetColormap(pixs);
#  156|       if (!cmap && d != 32)
#  157|->         return (PIX *)ERROR_PTR("not cmapped or rgb", __func__, pixd);
#  158|   
#  159|       if (!pixd)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def550]
leptonica-1.87.0/src/colorspace.c:160:16: warning[-Wanalyzer-malloc-leak]: leak of ‘hlut’
leptonica-1.87.0/src/colorspace.c:789:1: enter_function: entry to ‘pixMakeRangeMaskHV’
leptonica-1.87.0/src/colorspace.c:802:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:804:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:809:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:809:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:813:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:815:15: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: following ‘false’ branch (when ‘hstart >= hend’)...
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: following ‘false’ branch (when ‘i == 240’)...
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:823:21: branch_false: following ‘false’ branch (when ‘i > hend’)...
leptonica-1.87.0/src/colorspace.c:828:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:828:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskHV’
#  158|   
#  159|       if (!pixd)
#  160|->         pixd = pixCopy(NULL, pixs);
#  161|   
#  162|       cmap = pixGetColormap(pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def551]
leptonica-1.87.0/src/colorspace.c:160:16: warning[-Wanalyzer-malloc-leak]: leak of ‘slut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:906:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  158|   
#  159|       if (!pixd)
#  160|->         pixd = pixCopy(NULL, pixs);
#  161|   
#  162|       cmap = pixGetColormap(pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def552]
leptonica-1.87.0/src/colorspace.c:160:16: warning[-Wanalyzer-malloc-leak]: leak of ‘vlut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:907:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  158|   
#  159|       if (!pixd)
#  160|->         pixd = pixCopy(NULL, pixs);
#  161|   
#  162|       cmap = pixGetColormap(pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def553]
leptonica-1.87.0/src/colorspace.c:162:12: warning[-Wanalyzer-malloc-leak]: leak of ‘hlut’
leptonica-1.87.0/src/colorspace.c:789:1: enter_function: entry to ‘pixMakeRangeMaskHV’
leptonica-1.87.0/src/colorspace.c:802:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:804:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:809:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:809:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:813:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:815:15: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: following ‘false’ branch (when ‘hstart >= hend’)...
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: following ‘false’ branch (when ‘i == 240’)...
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:823:21: branch_false: following ‘false’ branch (when ‘i > hend’)...
leptonica-1.87.0/src/colorspace.c:828:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:828:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskHV’
#  160|           pixd = pixCopy(NULL, pixs);
#  161|   
#  162|->     cmap = pixGetColormap(pixd);
#  163|       if (cmap) {   /* just convert the colormap */
#  164|           pixcmapConvertRGBToHSV(cmap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def554]
leptonica-1.87.0/src/colorspace.c:162:12: warning[-Wanalyzer-malloc-leak]: leak of ‘slut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:906:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  160|           pixd = pixCopy(NULL, pixs);
#  161|   
#  162|->     cmap = pixGetColormap(pixd);
#  163|       if (cmap) {   /* just convert the colormap */
#  164|           pixcmapConvertRGBToHSV(cmap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def555]
leptonica-1.87.0/src/colorspace.c:162:12: warning[-Wanalyzer-malloc-leak]: leak of ‘vlut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:907:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  160|           pixd = pixCopy(NULL, pixs);
#  161|   
#  162|->     cmap = pixGetColormap(pixd);
#  163|       if (cmap) {   /* just convert the colormap */
#  164|           pixcmapConvertRGBToHSV(cmap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def556]
leptonica-1.87.0/src/colorspace.c:431:15: warning[-Wanalyzer-malloc-leak]: leak of ‘hlut’
leptonica-1.87.0/src/colorspace.c:789:1: enter_function: entry to ‘pixMakeRangeMaskHV’
leptonica-1.87.0/src/colorspace.c:802:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:804:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:809:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:809:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:813:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:815:15: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: following ‘false’ branch (when ‘hstart >= hend’)...
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: following ‘false’ branch (when ‘i == 240’)...
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:823:21: branch_false: following ‘false’ branch (when ‘i > hend’)...
leptonica-1.87.0/src/colorspace.c:828:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:828:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskHV’
#  429|           return ERROR_INT("cmap not defined", __func__, 1);
#  430|   
#  431|->     ncolors = pixcmapGetCount(cmap);
#  432|       for (i = 0; i < ncolors; i++) {
#  433|           pixcmapGetColor(cmap, i, &rval, &gval, &bval);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def557]
leptonica-1.87.0/src/colorspace.c:431:15: warning[-Wanalyzer-malloc-leak]: leak of ‘slut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:906:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  429|           return ERROR_INT("cmap not defined", __func__, 1);
#  430|   
#  431|->     ncolors = pixcmapGetCount(cmap);
#  432|       for (i = 0; i < ncolors; i++) {
#  433|           pixcmapGetColor(cmap, i, &rval, &gval, &bval);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def558]
leptonica-1.87.0/src/colorspace.c:431:15: warning[-Wanalyzer-malloc-leak]: leak of ‘vlut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:907:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  429|           return ERROR_INT("cmap not defined", __func__, 1);
#  430|   
#  431|->     ncolors = pixcmapGetCount(cmap);
#  432|       for (i = 0; i < ncolors; i++) {
#  433|           pixcmapGetColor(cmap, i, &rval, &gval, &bval);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def559]
leptonica-1.87.0/src/colorspace.c:433:9: warning[-Wanalyzer-malloc-leak]: leak of ‘hlut’
leptonica-1.87.0/src/colorspace.c:789:1: enter_function: entry to ‘pixMakeRangeMaskHV’
leptonica-1.87.0/src/colorspace.c:802:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:804:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:809:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:809:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:813:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:815:15: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: following ‘false’ branch (when ‘hstart >= hend’)...
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: following ‘false’ branch (when ‘i == 240’)...
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:823:21: branch_false: following ‘false’ branch (when ‘i > hend’)...
leptonica-1.87.0/src/colorspace.c:828:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:828:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskHV’
#  431|       ncolors = pixcmapGetCount(cmap);
#  432|       for (i = 0; i < ncolors; i++) {
#  433|->         pixcmapGetColor(cmap, i, &rval, &gval, &bval);
#  434|           convertRGBToHSV(rval, gval, bval, &hval, &sval, &vval);
#  435|           pixcmapResetColor(cmap, i, hval, sval, vval);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def560]
leptonica-1.87.0/src/colorspace.c:433:9: warning[-Wanalyzer-malloc-leak]: leak of ‘slut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:906:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  431|       ncolors = pixcmapGetCount(cmap);
#  432|       for (i = 0; i < ncolors; i++) {
#  433|->         pixcmapGetColor(cmap, i, &rval, &gval, &bval);
#  434|           convertRGBToHSV(rval, gval, bval, &hval, &sval, &vval);
#  435|           pixcmapResetColor(cmap, i, hval, sval, vval);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def561]
leptonica-1.87.0/src/colorspace.c:433:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vlut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:907:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  431|       ncolors = pixcmapGetCount(cmap);
#  432|       for (i = 0; i < ncolors; i++) {
#  433|->         pixcmapGetColor(cmap, i, &rval, &gval, &bval);
#  434|           convertRGBToHSV(rval, gval, bval, &hval, &sval, &vval);
#  435|           pixcmapResetColor(cmap, i, hval, sval, vval);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def562]
leptonica-1.87.0/src/colorspace.c:435:9: warning[-Wanalyzer-malloc-leak]: leak of ‘hlut’
leptonica-1.87.0/src/colorspace.c:789:1: enter_function: entry to ‘pixMakeRangeMaskHV’
leptonica-1.87.0/src/colorspace.c:802:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:804:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:809:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:809:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:813:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:815:15: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: following ‘false’ branch (when ‘hstart >= hend’)...
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: following ‘false’ branch (when ‘i == 240’)...
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:823:21: branch_false: following ‘false’ branch (when ‘i > hend’)...
leptonica-1.87.0/src/colorspace.c:828:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:828:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskHV’
#  433|           pixcmapGetColor(cmap, i, &rval, &gval, &bval);
#  434|           convertRGBToHSV(rval, gval, bval, &hval, &sval, &vval);
#  435|->         pixcmapResetColor(cmap, i, hval, sval, vval);
#  436|       }
#  437|       return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def563]
leptonica-1.87.0/src/colorspace.c:435:9: warning[-Wanalyzer-malloc-leak]: leak of ‘slut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:906:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  433|           pixcmapGetColor(cmap, i, &rval, &gval, &bval);
#  434|           convertRGBToHSV(rval, gval, bval, &hval, &sval, &vval);
#  435|->         pixcmapResetColor(cmap, i, hval, sval, vval);
#  436|       }
#  437|       return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def564]
leptonica-1.87.0/src/colorspace.c:435:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vlut’
leptonica-1.87.0/src/colorspace.c:885:1: enter_function: entry to ‘pixMakeRangeMaskSV’
leptonica-1.87.0/src/colorspace.c:898:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:900:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:906:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:907:23: acquire_memory: allocated here
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:912:22: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:914:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:918:12: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:918:12: call_function: calling ‘pixConvertRGBToHSV’ from ‘pixMakeRangeMaskSV’
#  433|           pixcmapGetColor(cmap, i, &rval, &gval, &bval);
#  434|           convertRGBToHSV(rval, gval, bval, &hval, &sval, &vval);
#  435|->         pixcmapResetColor(cmap, i, hval, sval, vval);
#  436|       }
#  437|       return 0;

Error: CPPCHECK_WARNING (CWE-476): [#def565]
leptonica-1.87.0/src/colorspace.c:717: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: slut
#  715|       send = L_MIN(255, satcenter + sathw);
#  716|       for (i = sstart; i <= send; i++)
#  717|->         slut[i] = 1;
#  718|       hstart = (huecenter - huehw + 240) % 240;
#  719|       hend = (huecenter + huehw + 240) % 240;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def566]
leptonica-1.87.0/src/colorspace.c:727:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘hlut’
leptonica-1.87.0/src/colorspace.c:705:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:707:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:712:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:712:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/colorspace.c:716:22: branch_false: following ‘false’ branch (when ‘i > send’)...
leptonica-1.87.0/src/colorspace.c:718:15: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:720:8: branch_false: following ‘false’ branch (when ‘hstart >= hend’)...
leptonica-1.87.0/src/colorspace.c:720:8: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:724:26: branch_false: following ‘false’ branch (when ‘i == 240’)...
leptonica-1.87.0/src/colorspace.c:724:26: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:726:21: branch_true: following ‘true’ branch (when ‘i <= hend’)...
leptonica-1.87.0/src/colorspace.c:727:17: branch_true: ...to here
leptonica-1.87.0/src/colorspace.c:727:13: danger: ‘hlut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/4)
#  725|               hlut[i] = 1;
#  726|           for (i = 0; i <= hend; i++)
#  727|->             hlut[i] = 1;
#  728|       }
#  729|   

Error: CPPCHECK_WARNING (CWE-476): [#def567]
leptonica-1.87.0/src/colorspace.c:814: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vlut
#  812|       vend = L_MIN(255, valcenter + valhw);
#  813|       for (i = vstart; i <= vend; i++)
#  814|->         vlut[i] = 1;
#  815|       hstart = (huecenter - huehw + 240) % 240;
#  816|       hend = (huecenter + huehw + 240) % 240;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def568]
leptonica-1.87.0/src/colorspace.c:824:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘hlut’
leptonica-1.87.0/src/colorspace.c:802:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:804:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/colorspace.c:809:23: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:809:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/colorspace.c:813:22: branch_false: following ‘false’ branch (when ‘i > vend’)...
leptonica-1.87.0/src/colorspace.c:815:15: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: following ‘false’ branch (when ‘hstart >= hend’)...
leptonica-1.87.0/src/colorspace.c:817:8: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: following ‘false’ branch (when ‘i == 240’)...
leptonica-1.87.0/src/colorspace.c:821:26: branch_false: ...to here
leptonica-1.87.0/src/colorspace.c:823:21: branch_true: following ‘true’ branch (when ‘i <= hend’)...
leptonica-1.87.0/src/colorspace.c:824:17: branch_true: ...to here
leptonica-1.87.0/src/colorspace.c:824:13: danger: ‘hlut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/4)
#  822|               hlut[i] = 1;
#  823|           for (i = 0; i <= hend; i++)
#  824|->             hlut[i] = 1;
#  825|       }
#  826|   

Error: CPPCHECK_WARNING (CWE-476): [#def569]
leptonica-1.87.0/src/colorspace.c:913: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: slut
#  911|       vend = L_MIN(255, valcenter + valhw);
#  912|       for (i = sstart; i <= send; i++)
#  913|->         slut[i] = 1;
#  914|       for (i = vstart; i <= vend; i++)
#  915|           vlut[i] = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def570]
leptonica-1.87.0/src/colorspace.c:915: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: vlut
#  913|           slut[i] = 1;
#  914|       for (i = vstart; i <= vend; i++)
#  915|->         vlut[i] = 1;
#  916|   
#  917|           /* Generate the mask */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def571]
leptonica-1.87.0/src/compare.c:2041:11: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2041:11: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/compare.c:2041:11: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
# 2039|       if ((n3a = (NUMAA **)LEPT_CALLOC(nim, sizeof(NUMAA *))) == NULL)
# 2040|           return ERROR_INT("calloc fail for n3a", __func__, 1);
# 2041|->     naw = numaCreate(0);
# 2042|       nah = numaCreate(0);
# 2043|       for (i = 0; i < nim; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def572]
leptonica-1.87.0/src/compare.c:2042:11: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2042:11: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/compare.c:2042:11: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
# 2040|           return ERROR_INT("calloc fail for n3a", __func__, 1);
# 2041|       naw = numaCreate(0);
# 2042|->     nah = numaCreate(0);
# 2043|       for (i = 0; i < nim; i++) {
# 2044|           pix = pixaGetPix(pixa, i, L_CLONE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def573]
leptonica-1.87.0/src/compare.c:2044:15: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2044:15: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2044:15: throw: if ‘pixaGetPix’ throws an exception...
leptonica-1.87.0/src/compare.c:2044:15: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
# 2042|       nah = numaCreate(0);
# 2043|       for (i = 0; i < nim; i++) {
# 2044|->         pix = pixaGetPix(pixa, i, L_CLONE);
# 2045|           text = pixGetText(pix);
# 2046|           pixSetResolution(pix, 150, 150);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def574]
leptonica-1.87.0/src/compare.c:2045:16: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2044:15: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2045:16: throw: if ‘pixGetText’ throws an exception...
leptonica-1.87.0/src/compare.c:2045:16: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12)
# 2043|       for (i = 0; i < nim; i++) {
# 2044|           pix = pixaGetPix(pixa, i, L_CLONE);
# 2045|->         text = pixGetText(pix);
# 2046|           pixSetResolution(pix, 150, 150);
# 2047|           index = (debug) ? i : 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def575]
leptonica-1.87.0/src/compare.c:2046:9: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2044:15: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2046:9: throw: if ‘pixSetResolution’ throws an exception...
leptonica-1.87.0/src/compare.c:2046:9: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/12)
# 2044|           pix = pixaGetPix(pixa, i, L_CLONE);
# 2045|           text = pixGetText(pix);
# 2046|->         pixSetResolution(pix, 150, 150);
# 2047|           index = (debug) ? i : 0;
# 2048|           pixGenPhotoHistos(pix, NULL, factor, textthresh, n,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def576]
leptonica-1.87.0/src/compare.c:2069:9: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_true: following ‘true’ branch (when ‘scores’ is NULL)...
leptonica-1.87.0/src/compare.c:2069:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2069:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2069:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2069:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/compare.c:2069:9: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/12)
# 2067|                  (l_float32 *)LEPT_CALLOC((size_t)nim * nim, sizeof(l_float32)))
# 2068|                   == NULL) {
# 2069|->         L_ERROR("calloc fail for scores\n", __func__);
# 2070|           goto cleanup;
# 2071|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def577]
leptonica-1.87.0/src/compare.c:2072:11: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2072:11: throw: if ‘numaMakeConstant’ throws an exception...
leptonica-1.87.0/src/compare.c:2072:11: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
# 2070|           goto cleanup;
# 2071|       }
# 2072|->     nai = numaMakeConstant(-1, nim);  /* classid array */
# 2073|       for (i = 0, classid = 0; i < nim; i++) {
# 2074|           scores[nim * i + i] = 1.0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def578]
leptonica-1.87.0/src/compare.c:2072:11: warning[-Wanalyzer-malloc-leak]: leak of ‘scores’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2067:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2072:11: throw: if ‘numaMakeConstant’ throws an exception...
leptonica-1.87.0/src/compare.c:2072:11: danger: ‘scores’ leaks here; was allocated at [(17)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/16)
# 2070|           goto cleanup;
# 2071|       }
# 2072|->     nai = numaMakeConstant(-1, nim);  /* classid array */
# 2073|       for (i = 0, classid = 0; i < nim; i++) {
# 2074|           scores[nim * i + i] = 1.0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def579]
leptonica-1.87.0/src/compare.c:2119:16: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2119:16: throw: if ‘pixCreate’ throws an exception...
leptonica-1.87.0/src/compare.c:2119:16: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/12)
# 2117|           l_uint32  *line, *data;
# 2118|           PIX       *pix2, *pix3;
# 2119|->         pix2 = pixCreate(nim, nim, 8);
# 2120|           data = pixGetData(pix2);
# 2121|           wpl = pixGetWpl(pix2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def580]
leptonica-1.87.0/src/compare.c:2119:16: warning[-Wanalyzer-malloc-leak]: leak of ‘scores’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2067:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2119:16: throw: if ‘pixCreate’ throws an exception...
leptonica-1.87.0/src/compare.c:2119:16: danger: ‘scores’ leaks here; was allocated at [(17)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/16)
# 2117|           l_uint32  *line, *data;
# 2118|           PIX       *pix2, *pix3;
# 2119|->         pix2 = pixCreate(nim, nim, 8);
# 2120|           data = pixGetData(pix2);
# 2121|           wpl = pixGetWpl(pix2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def581]
leptonica-1.87.0/src/compare.c:2120:16: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2120:16: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/compare.c:2120:16: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/12)
# 2118|           PIX       *pix2, *pix3;
# 2119|           pix2 = pixCreate(nim, nim, 8);
# 2120|->         data = pixGetData(pix2);
# 2121|           wpl = pixGetWpl(pix2);
# 2122|           for (i = 0; i < nim; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def582]
leptonica-1.87.0/src/compare.c:2120:16: warning[-Wanalyzer-malloc-leak]: leak of ‘scores’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2067:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2120:16: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/compare.c:2120:16: danger: ‘scores’ leaks here; was allocated at [(17)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/16)
# 2118|           PIX       *pix2, *pix3;
# 2119|           pix2 = pixCreate(nim, nim, 8);
# 2120|->         data = pixGetData(pix2);
# 2121|           wpl = pixGetWpl(pix2);
# 2122|           for (i = 0; i < nim; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def583]
leptonica-1.87.0/src/compare.c:2121:15: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2121:15: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/compare.c:2121:15: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/12)
# 2119|           pix2 = pixCreate(nim, nim, 8);
# 2120|           data = pixGetData(pix2);
# 2121|->         wpl = pixGetWpl(pix2);
# 2122|           for (i = 0; i < nim; i++) {
# 2123|               line = data + i * wpl;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def584]
leptonica-1.87.0/src/compare.c:2121:15: warning[-Wanalyzer-malloc-leak]: leak of ‘scores’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2067:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2121:15: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/compare.c:2121:15: danger: ‘scores’ leaks here; was allocated at [(17)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/16)
# 2119|           pix2 = pixCreate(nim, nim, 8);
# 2120|           data = pixGetData(pix2);
# 2121|->         wpl = pixGetWpl(pix2);
# 2122|           for (i = 0; i < nim; i++) {
# 2123|               line = data + i * wpl;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def585]
leptonica-1.87.0/src/compare.c:2130:16: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2130:16: throw: if ‘pixExpandReplicate’ throws an exception...
leptonica-1.87.0/src/compare.c:2130:16: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/12)
# 2128|           }
# 2129|           fact = L_MAX(2, 1000 / nim);
# 2130|->         pix3 = pixExpandReplicate(pix2, fact);
# 2131|           lept_stderr("Writing to /tmp/lept/comp/scorearray.png\n");
# 2132|           lept_mkdir("lept/comp");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def586]
leptonica-1.87.0/src/compare.c:2130:16: warning[-Wanalyzer-malloc-leak]: leak of ‘scores’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2067:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2130:16: throw: if ‘pixExpandReplicate’ throws an exception...
leptonica-1.87.0/src/compare.c:2130:16: danger: ‘scores’ leaks here; was allocated at [(17)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/16)
# 2128|           }
# 2129|           fact = L_MAX(2, 1000 / nim);
# 2130|->         pix3 = pixExpandReplicate(pix2, fact);
# 2131|           lept_stderr("Writing to /tmp/lept/comp/scorearray.png\n");
# 2132|           lept_mkdir("lept/comp");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def587]
leptonica-1.87.0/src/compare.c:2131:9: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2131:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/compare.c:2131:9: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/12)
# 2129|           fact = L_MAX(2, 1000 / nim);
# 2130|           pix3 = pixExpandReplicate(pix2, fact);
# 2131|->         lept_stderr("Writing to /tmp/lept/comp/scorearray.png\n");
# 2132|           lept_mkdir("lept/comp");
# 2133|           pixWrite("/tmp/lept/comp/scorearray.png", pix3, IFF_PNG);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def588]
leptonica-1.87.0/src/compare.c:2131:9: warning[-Wanalyzer-malloc-leak]: leak of ‘scores’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2067:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2131:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/compare.c:2131:9: danger: ‘scores’ leaks here; was allocated at [(17)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/16)
# 2129|           fact = L_MAX(2, 1000 / nim);
# 2130|           pix3 = pixExpandReplicate(pix2, fact);
# 2131|->         lept_stderr("Writing to /tmp/lept/comp/scorearray.png\n");
# 2132|           lept_mkdir("lept/comp");
# 2133|           pixWrite("/tmp/lept/comp/scorearray.png", pix3, IFF_PNG);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def589]
leptonica-1.87.0/src/compare.c:2132:9: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2132:9: throw: if ‘lept_mkdir’ throws an exception...
leptonica-1.87.0/src/compare.c:2132:9: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/12)
# 2130|           pix3 = pixExpandReplicate(pix2, fact);
# 2131|           lept_stderr("Writing to /tmp/lept/comp/scorearray.png\n");
# 2132|->         lept_mkdir("lept/comp");
# 2133|           pixWrite("/tmp/lept/comp/scorearray.png", pix3, IFF_PNG);
# 2134|           pixDestroy(&pix2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def590]
leptonica-1.87.0/src/compare.c:2132:9: warning[-Wanalyzer-malloc-leak]: leak of ‘scores’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2067:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2132:9: throw: if ‘lept_mkdir’ throws an exception...
leptonica-1.87.0/src/compare.c:2132:9: danger: ‘scores’ leaks here; was allocated at [(17)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/16)
# 2130|           pix3 = pixExpandReplicate(pix2, fact);
# 2131|           lept_stderr("Writing to /tmp/lept/comp/scorearray.png\n");
# 2132|->         lept_mkdir("lept/comp");
# 2133|           pixWrite("/tmp/lept/comp/scorearray.png", pix3, IFF_PNG);
# 2134|           pixDestroy(&pix2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def591]
leptonica-1.87.0/src/compare.c:2133:9: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2133:9: throw: if ‘pixWrite’ throws an exception...
leptonica-1.87.0/src/compare.c:2133:9: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/12)
# 2131|           lept_stderr("Writing to /tmp/lept/comp/scorearray.png\n");
# 2132|           lept_mkdir("lept/comp");
# 2133|->         pixWrite("/tmp/lept/comp/scorearray.png", pix3, IFF_PNG);
# 2134|           pixDestroy(&pix2);
# 2135|           pixDestroy(&pix3);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def592]
leptonica-1.87.0/src/compare.c:2133:9: warning[-Wanalyzer-malloc-leak]: leak of ‘scores’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2067:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2133:9: throw: if ‘pixWrite’ throws an exception...
leptonica-1.87.0/src/compare.c:2133:9: danger: ‘scores’ leaks here; was allocated at [(17)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/16)
# 2131|           lept_stderr("Writing to /tmp/lept/comp/scorearray.png\n");
# 2132|           lept_mkdir("lept/comp");
# 2133|->         pixWrite("/tmp/lept/comp/scorearray.png", pix3, IFF_PNG);
# 2134|           pixDestroy(&pix2);
# 2135|           pixDestroy(&pix3);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def593]
leptonica-1.87.0/src/compare.c:2134:9: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2134:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/compare.c:2134:9: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/12)
# 2132|           lept_mkdir("lept/comp");
# 2133|           pixWrite("/tmp/lept/comp/scorearray.png", pix3, IFF_PNG);
# 2134|->         pixDestroy(&pix2);
# 2135|           pixDestroy(&pix3);
# 2136|           *pscores = scores;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def594]
leptonica-1.87.0/src/compare.c:2134:9: warning[-Wanalyzer-malloc-leak]: leak of ‘scores’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2067:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2134:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/compare.c:2134:9: danger: ‘scores’ leaks here; was allocated at [(17)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/16)
# 2132|           lept_mkdir("lept/comp");
# 2133|           pixWrite("/tmp/lept/comp/scorearray.png", pix3, IFF_PNG);
# 2134|->         pixDestroy(&pix2);
# 2135|           pixDestroy(&pix3);
# 2136|           *pscores = scores;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def595]
leptonica-1.87.0/src/compare.c:2135:9: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2135:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/compare.c:2135:9: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/12)
# 2133|           pixWrite("/tmp/lept/comp/scorearray.png", pix3, IFF_PNG);
# 2134|           pixDestroy(&pix2);
# 2135|->         pixDestroy(&pix3);
# 2136|           *pscores = scores;
# 2137|       } else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def596]
leptonica-1.87.0/src/compare.c:2135:9: warning[-Wanalyzer-malloc-leak]: leak of ‘scores’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2067:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2119:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2122:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2129:16: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2135:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/compare.c:2135:9: danger: ‘scores’ leaks here; was allocated at [(17)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/16)
# 2133|           pixWrite("/tmp/lept/comp/scorearray.png", pix3, IFF_PNG);
# 2134|           pixDestroy(&pix2);
# 2135|->         pixDestroy(&pix3);
# 2136|           *pscores = scores;
# 2137|       } else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def597]
leptonica-1.87.0/src/compare.c:2145:18: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_false: following ‘false’ branch (when ‘scores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2072:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2073:30: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2107:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2115:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2138:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2144:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2145:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2145:18: throw: if ‘pixaDisplayTiledByIndex’ throws an exception...
leptonica-1.87.0/src/compare.c:2145:18: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/12)
# 2143|            * images are displayed in the same column. */
# 2144|       if (ppixd)
# 2145|->         *ppixd = pixaDisplayTiledByIndex(pixa, nai, 200, 20, 2, 6, 0x0000ff00);
# 2146|   
# 2147|   cleanup:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def598]
leptonica-1.87.0/src/compare.c:2148:5: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_true: following ‘true’ branch (when ‘scores’ is NULL)...
leptonica-1.87.0/src/compare.c:2069:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2148:5: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/compare.c:2148:5: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/12)
# 2146|   
# 2147|   cleanup:
# 2148|->     numaDestroy(&naw);
# 2149|       numaDestroy(&nah);
# 2150|       for (i = 0; i < nim; i++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def599]
leptonica-1.87.0/src/compare.c:2149:5: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:2017:8: branch_false: following ‘false’ branch (when ‘pscores’ is NULL)...
leptonica-1.87.0/src/compare.c:2018:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2067:29: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2066:8: branch_true: following ‘true’ branch (when ‘scores’ is NULL)...
leptonica-1.87.0/src/compare.c:2069:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2149:5: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/compare.c:2149:5: danger: ‘n3a’ leaks here; was allocated at [(13)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/12)
# 2147|   cleanup:
# 2148|       numaDestroy(&naw);
# 2149|->     numaDestroy(&nah);
# 2150|       for (i = 0; i < nim; i++)
# 2151|           numaaDestroy(&n3a[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def600]
leptonica-1.87.0/src/compare.c:2354:18: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:1997:1: enter_function: entry to ‘pixaComparePhotoRegionsByHisto’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2044:15: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2047:17: branch_true: following ‘true’ branch (when ‘debug != 0’)...
leptonica-1.87.0/src/compare.c:2048:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2048:9: call_function: calling ‘pixGenPhotoHistos’ from ‘pixaComparePhotoRegionsByHisto’
# 2352|       if (!pw || !ph)
# 2353|           return ERROR_INT("&w and &h not both defined", __func__, 1);
# 2354|->     if (!pixs || pixGetDepth(pixs) == 1)
# 2355|           return ERROR_INT("pixs not defined or 1 bpp", __func__, 1);
# 2356|       if (factor < 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def601]
leptonica-1.87.0/src/compare.c:2355:16: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:1997:1: enter_function: entry to ‘pixaComparePhotoRegionsByHisto’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2044:15: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2047:17: branch_true: following ‘true’ branch (when ‘debug != 0’)...
leptonica-1.87.0/src/compare.c:2048:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2048:9: call_function: calling ‘pixGenPhotoHistos’ from ‘pixaComparePhotoRegionsByHisto’
# 2353|           return ERROR_INT("&w and &h not both defined", __func__, 1);
# 2354|       if (!pixs || pixGetDepth(pixs) == 1)
# 2355|->         return ERROR_INT("pixs not defined or 1 bpp", __func__, 1);
# 2356|       if (factor < 1)
# 2357|           return ERROR_INT("subsampling factor must be >= 1", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def602]
leptonica-1.87.0/src/compare.c:2374:16: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:1997:1: enter_function: entry to ‘pixaComparePhotoRegionsByHisto’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2044:15: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2047:17: branch_true: following ‘true’ branch (when ‘debug != 0’)...
leptonica-1.87.0/src/compare.c:2048:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2048:9: call_function: calling ‘pixGenPhotoHistos’ from ‘pixaComparePhotoRegionsByHisto’
# 2372|           pix1 = pixClipRectangle(pixs, box, NULL);
# 2373|       else
# 2374|->         pix1 = pixClone(pixs);
# 2375|   
# 2376|           /* Convert to 8 bpp and pad to center the centroid */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def603]
leptonica-1.87.0/src/compare.c:2377:12: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:1997:1: enter_function: entry to ‘pixaComparePhotoRegionsByHisto’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2044:15: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2047:17: branch_true: following ‘true’ branch (when ‘debug != 0’)...
leptonica-1.87.0/src/compare.c:2048:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2048:9: call_function: calling ‘pixGenPhotoHistos’ from ‘pixaComparePhotoRegionsByHisto’
# 2375|   
# 2376|           /* Convert to 8 bpp and pad to center the centroid */
# 2377|->     pix2 = pixConvertTo8(pix1, FALSE);
# 2378|       pix3 = pixPadToCenterCentroid(pix2, factor);
# 2379|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def604]
leptonica-1.87.0/src/compare.c:2452:23: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:1997:1: enter_function: entry to ‘pixaComparePhotoRegionsByHisto’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2044:15: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2047:17: branch_true: following ‘true’ branch (when ‘debug != 0’)...
leptonica-1.87.0/src/compare.c:2048:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2048:9: call_function: calling ‘pixGenPhotoHistos’ from ‘pixaComparePhotoRegionsByHisto’
# 2450|   
# 2451|       if (!pixs)
# 2452|->         return (PIX *)ERROR_PTR("pixs not defined", __func__, NULL);
# 2453|       if (factor < 1)
# 2454|           return (PIX *)ERROR_PTR("invalid sampling factor", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def605]
leptonica-1.87.0/src/compare.c:2456:12: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:1997:1: enter_function: entry to ‘pixaComparePhotoRegionsByHisto’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2044:15: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2047:17: branch_true: following ‘true’ branch (when ‘debug != 0’)...
leptonica-1.87.0/src/compare.c:2048:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2048:9: call_function: calling ‘pixGenPhotoHistos’ from ‘pixaComparePhotoRegionsByHisto’
# 2454|           return (PIX *)ERROR_PTR("invalid sampling factor", __func__, NULL);
# 2455|   
# 2456|->     pix1 = pixConvertTo8(pixs, FALSE);
# 2457|       pixCentroid8(pix1, factor, &cx, &cy);
# 2458|       icx = (l_int32)(cx + 0.5);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def606]
leptonica-1.87.0/src/compare.c:2507:18: warning[-Wanalyzer-malloc-leak]: leak of ‘n3a’
leptonica-1.87.0/src/compare.c:1997:1: enter_function: entry to ‘pixaComparePhotoRegionsByHisto’
leptonica-1.87.0/src/compare.c:2017:8: branch_true: following ‘true’ branch (when ‘pscores’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2017:18: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2018:8: branch_true: following ‘true’ branch (when ‘ppixd’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2018:16: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2019:8: branch_false: following ‘false’ branch (when ‘pnai’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2021:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2022:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2024:8: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2024:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/compare.c:2027:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/compare.c:2029:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2039:26: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:2039:8: branch_false: following ‘false’ branch (when ‘n3a’ is non-NULL)...
leptonica-1.87.0/src/compare.c:2041:11: branch_false: ...to here
leptonica-1.87.0/src/compare.c:2043:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/compare.c:2044:15: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2047:17: branch_true: following ‘true’ branch (when ‘debug != 0’)...
leptonica-1.87.0/src/compare.c:2048:9: branch_true: ...to here
leptonica-1.87.0/src/compare.c:2048:9: call_function: calling ‘pixGenPhotoHistos’ from ‘pixaComparePhotoRegionsByHisto’
# 2505|       if (pcx) *pcx = 0.0;
# 2506|       if (pcy) *pcy = 0.0;
# 2507|->     if (!pixs || pixGetDepth(pixs) != 8)
# 2508|           return ERROR_INT("pixs undefined or not 8 bpp", __func__, 1);
# 2509|       if (factor < 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def607]
leptonica-1.87.0/src/compare.c:3314:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bytea’
leptonica-1.87.0/src/compare.c:3297:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/compare.c:3299:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:3300:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/compare.c:3302:9: branch_false: ...to here
leptonica-1.87.0/src/compare.c:3311:29: acquire_memory: allocated here
leptonica-1.87.0/src/compare.c:3311:8: branch_false: following ‘false’ branch (when ‘bytea’ is non-NULL)...
leptonica-1.87.0/src/compare.c:3313:5: branch_false: ...to here
leptonica-1.87.0/src/compare.c:3314:5: throw: if ‘l_setDataFourBytes’ throws an exception...
leptonica-1.87.0/src/compare.c:3314:5: danger: ‘bytea’ leaks here; was allocated at [(5)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/4)
# 3312|           return (l_uint8 *)ERROR_PTR("bytea not made", __func__, NULL);
# 3313|       *psize = 8 + 256 * n;
# 3314|->     l_setDataFourBytes(bytea, 0, w);
# 3315|       l_setDataFourBytes(bytea, 1, h);
# 3316|       for (i = 0; i < n; i++) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def608]
leptonica-1.87.0/src/conncomp.c:675:14: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘x1’
leptonica-1.87.0/src/conncomp.c:559:1: enter_function: entry to ‘pixSeedfillBB’
leptonica-1.87.0/src/conncomp.c:569:8: branch_false: following ‘false’ branch (when ‘stack’ is non-NULL)...
leptonica-1.87.0/src/conncomp.c:571:9: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:571:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/conncomp.c:574:8: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:574:8: branch_true: following ‘true’ branch (when ‘connectivity == 4’)...
leptonica-1.87.0/src/conncomp.c:575:20: branch_true: ...to here
leptonica-1.87.0/src/conncomp.c:575:20: call_function: calling ‘pixSeedfill4BB’ from ‘pixSeedfillBB’
#  673|                * And any segments found anywhere are always extended
#  674|                * in the +dy direction.  */
#  675|->         for (x = x1; x >= 0 && (GET_DATA_BIT(line, x) == 1); x--)
#  676|               CLEAR_DATA_BIT(line,x);
#  677|           if (x >= x1)  /* pix at x1 was off and was not cleared */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def609]
leptonica-1.87.0/src/conncomp.c:788:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘x1’
leptonica-1.87.0/src/conncomp.c:559:1: enter_function: entry to ‘pixSeedfillBB’
leptonica-1.87.0/src/conncomp.c:569:8: branch_false: following ‘false’ branch (when ‘stack’ is non-NULL)...
leptonica-1.87.0/src/conncomp.c:571:9: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:571:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/conncomp.c:574:8: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:574:8: branch_false: following ‘false’ branch (when ‘connectivity != 4’)...
leptonica-1.87.0/src/conncomp.c:578:20: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:578:20: call_function: calling ‘pixSeedfill8BB’ from ‘pixSeedfillBB’
#  786|                * And any segments found anywhere are always extended
#  787|                * in the +dy direction.  */
#  788|->         for (x = x1 - 1; x >= 0 && (GET_DATA_BIT(line, x) == 1); x--)
#  789|               CLEAR_DATA_BIT(line,x);
#  790|           if (x >= x1 - 1)  /* pix at x1 - 1 was off and was not cleared */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def610]
leptonica-1.87.0/src/conncomp.c:926:14: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘x1’
leptonica-1.87.0/src/conncomp.c:837:1: enter_function: entry to ‘pixSeedfill’
leptonica-1.87.0/src/conncomp.c:847:8: branch_false: following ‘false’ branch (when ‘stack’ is non-NULL)...
leptonica-1.87.0/src/conncomp.c:849:9: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:849:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/conncomp.c:852:8: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:852:8: branch_true: following ‘true’ branch (when ‘connectivity == 4’)...
leptonica-1.87.0/src/conncomp.c:853:18: branch_true: ...to here
leptonica-1.87.0/src/conncomp.c:853:18: call_function: calling ‘pixSeedfill4’ from ‘pixSeedfill’
#  924|                * And any segments found anywhere are always extended
#  925|                * in the +dy direction.  */
#  926|->         for (x = x1; x >= 0 && (GET_DATA_BIT(line, x) == 1); x--)
#  927|               CLEAR_DATA_BIT(line,x);
#  928|           if (x >= x1)  /* pix at x1 was off and was not cleared */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def611]
leptonica-1.87.0/src/conncomp.c:1018:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘x1’
leptonica-1.87.0/src/conncomp.c:971:1: enter_function: entry to ‘pixSeedfill8’
leptonica-1.87.0/src/conncomp.c:980:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/conncomp.c:982:8: branch_false: following ‘false’ branch (when ‘stack’ is non-NULL)...
leptonica-1.87.0/src/conncomp.c:984:10: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:995:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/conncomp.c:999:5: call_function: calling ‘pushFillseg’ from ‘pixSeedfill8’
leptonica-1.87.0/src/conncomp.c:999:5: return_function: returning to ‘pixSeedfill8’ from ‘pushFillseg’
leptonica-1.87.0/src/conncomp.c:1000:5: call_function: calling ‘pushFillseg’ from ‘pixSeedfill8’
leptonica-1.87.0/src/conncomp.c:1000:5: return_function: returning to ‘pixSeedfill8’ from ‘pushFillseg’
leptonica-1.87.0/src/conncomp.c:1002:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/conncomp.c:1004:9: branch_true: ...to here
leptonica-1.87.0/src/conncomp.c:1004:9: call_function: calling ‘popFillseg’ from ‘pixSeedfill8’
leptonica-1.87.0/src/conncomp.c:1004:9: return_function: returning to ‘pixSeedfill8’ from ‘popFillseg’
leptonica-1.87.0/src/conncomp.c:1018:18: danger: use of uninitialized value ‘x1’ here
# 1016|                * And any segments found anywhere are always extended
# 1017|                * in the +dy direction.  */
# 1018|->         for (x = x1 - 1; x >= 0 && (GET_DATA_BIT(line, x) == 1); x--)
# 1019|               CLEAR_DATA_BIT(line,x);
# 1020|           if (x >= x1 - 1)  /* pix at x1 - 1 was off and was not cleared */

Error: CPPCHECK_WARNING (CWE-476): [#def612]
leptonica-1.87.0/src/conncomp.c:1107: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fseg
# 1105|           else
# 1106|               fseg = (FILLSEG *)LEPT_CALLOC(1, sizeof(FILLSEG));
# 1107|->         fseg->xleft = xleft;
# 1108|           fseg->xright = xright;
# 1109|           fseg->y = y;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def613]
leptonica-1.87.0/src/conncomp.c:1107:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fseg’
leptonica-1.87.0/src/conncomp.c:1086:8: branch_false: following ‘false’ branch (when ‘stack’ is non-NULL)...
leptonica-1.87.0/src/conncomp.c:1091:14: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:1096:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/conncomp.c:1097:12: branch_false: following ‘false’ branch (when ‘auxstack’ is non-NULL)...
leptonica-1.87.0/src/conncomp.c:1103:13: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:1103:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/conncomp.c:1106:31: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:1106:31: acquire_memory: this call could return NULL
leptonica-1.87.0/src/conncomp.c:1107:9: danger: ‘fseg’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
# 1105|           else
# 1106|               fseg = (FILLSEG *)LEPT_CALLOC(1, sizeof(FILLSEG));
# 1107|->         fseg->xleft = xleft;
# 1108|           fseg->xright = xright;
# 1109|           fseg->y = y;

Error: CPPCHECK_WARNING (CWE-476): [#def614]
leptonica-1.87.0/src/conncomp.c:1108: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fseg
# 1106|               fseg = (FILLSEG *)LEPT_CALLOC(1, sizeof(FILLSEG));
# 1107|           fseg->xleft = xleft;
# 1108|->         fseg->xright = xright;
# 1109|           fseg->y = y;
# 1110|           fseg->dy = dy;

Error: CPPCHECK_WARNING (CWE-476): [#def615]
leptonica-1.87.0/src/conncomp.c:1109: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fseg
# 1107|           fseg->xleft = xleft;
# 1108|           fseg->xright = xright;
# 1109|->         fseg->y = y;
# 1110|           fseg->dy = dy;
# 1111|           lstackAdd(stack, fseg);

Error: CPPCHECK_WARNING (CWE-476): [#def616]
leptonica-1.87.0/src/conncomp.c:1110: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fseg
# 1108|           fseg->xright = xright;
# 1109|           fseg->y = y;
# 1110|->         fseg->dy = dy;
# 1111|           lstackAdd(stack, fseg);
# 1112|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def617]
leptonica-1.87.0/src/conncomp.c:1111:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fseg’
leptonica-1.87.0/src/conncomp.c:1086:8: branch_false: following ‘false’ branch (when ‘stack’ is non-NULL)...
leptonica-1.87.0/src/conncomp.c:1091:14: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:1096:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/conncomp.c:1097:12: branch_false: following ‘false’ branch (when ‘auxstack’ is non-NULL)...
leptonica-1.87.0/src/conncomp.c:1103:13: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:1103:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/conncomp.c:1106:31: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:1106:31: acquire_memory: allocated here
leptonica-1.87.0/src/conncomp.c:1111:9: throw: if ‘lstackAdd’ throws an exception...
leptonica-1.87.0/src/conncomp.c:1111:9: danger: ‘fseg’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
# 1109|           fseg->y = y;
# 1110|           fseg->dy = dy;
# 1111|->         lstackAdd(stack, fseg);
# 1112|       }
# 1113|   }

Error: CPPCHECK_WARNING (CWE-476): [#def618]
leptonica-1.87.0/src/conncomp.c:1161: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fseg
# 1159|           else
# 1160|               fseg = (FILLSEG *)LEPT_CALLOC(1, sizeof(FILLSEG));
# 1161|->         fseg->xleft = xleft;
# 1162|           fseg->xright = xright;
# 1163|           fseg->y = y;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def619]
leptonica-1.87.0/src/conncomp.c:1161:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fseg’
leptonica-1.87.0/src/conncomp.c:1151:12: branch_false: following ‘false’ branch (when ‘auxstack’ is non-NULL)...
leptonica-1.87.0/src/conncomp.c:1157:13: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:1157:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/conncomp.c:1160:31: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:1160:31: acquire_memory: this call could return NULL
leptonica-1.87.0/src/conncomp.c:1161:9: danger: ‘fseg’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
# 1159|           else
# 1160|               fseg = (FILLSEG *)LEPT_CALLOC(1, sizeof(FILLSEG));
# 1161|->         fseg->xleft = xleft;
# 1162|           fseg->xright = xright;
# 1163|           fseg->y = y;

Error: CPPCHECK_WARNING (CWE-476): [#def620]
leptonica-1.87.0/src/conncomp.c:1162: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fseg
# 1160|               fseg = (FILLSEG *)LEPT_CALLOC(1, sizeof(FILLSEG));
# 1161|           fseg->xleft = xleft;
# 1162|->         fseg->xright = xright;
# 1163|           fseg->y = y;
# 1164|           fseg->dy = dy;

Error: CPPCHECK_WARNING (CWE-476): [#def621]
leptonica-1.87.0/src/conncomp.c:1163: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fseg
# 1161|           fseg->xleft = xleft;
# 1162|           fseg->xright = xright;
# 1163|->         fseg->y = y;
# 1164|           fseg->dy = dy;
# 1165|           lstackAdd(stack, fseg);

Error: CPPCHECK_WARNING (CWE-476): [#def622]
leptonica-1.87.0/src/conncomp.c:1164: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fseg
# 1162|           fseg->xright = xright;
# 1163|           fseg->y = y;
# 1164|->         fseg->dy = dy;
# 1165|           lstackAdd(stack, fseg);
# 1166|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def623]
leptonica-1.87.0/src/conncomp.c:1165:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fseg’
leptonica-1.87.0/src/conncomp.c:1151:12: branch_false: following ‘false’ branch (when ‘auxstack’ is non-NULL)...
leptonica-1.87.0/src/conncomp.c:1157:13: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:1157:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/conncomp.c:1160:31: branch_false: ...to here
leptonica-1.87.0/src/conncomp.c:1160:31: acquire_memory: allocated here
leptonica-1.87.0/src/conncomp.c:1165:9: throw: if ‘lstackAdd’ throws an exception...
leptonica-1.87.0/src/conncomp.c:1165:9: danger: ‘fseg’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
# 1163|           fseg->y = y;
# 1164|           fseg->dy = dy;
# 1165|->         lstackAdd(stack, fseg);
# 1166|       }
# 1167|   }

Error: COMPILER_WARNING (CWE-457): [#def624]
leptonica-1.87.0/src/convolve.c: scope_hint: In function ‘pixWindowedVariance’
leptonica-1.87.0/src/convolve.c:1271:50: warning[-Wmaybe-uninitialized]: ‘wplv’ may be used uninitialized
# 1271 | l_int32     i, j, w, h, ws, hs, ds, wplm, wplms, wplv, wplrv, valm, valms;
#      |                                                  ^~~~
# 1269|                       FPIX  **pfpixrv)
# 1270|   {
# 1271|-> l_int32     i, j, w, h, ws, hs, ds, wplm, wplms, wplv, wplrv, valm, valms;
# 1272|   l_float32   var;
# 1273|   l_uint32   *linem, *linems, *datam, *datams;

Error: COMPILER_WARNING (CWE-457): [#def625]
leptonica-1.87.0/src/convolve.c:1271:56: warning[-Wmaybe-uninitialized]: ‘wplrv’ may be used uninitialized
# 1271 | l_int32     i, j, w, h, ws, hs, ds, wplm, wplms, wplv, wplrv, valm, valms;
#      |                                                        ^~~~~
# 1269|                       FPIX  **pfpixrv)
# 1270|   {
# 1271|-> l_int32     i, j, w, h, ws, hs, ds, wplm, wplms, wplv, wplrv, valm, valms;
# 1272|   l_float32   var;
# 1273|   l_uint32   *linem, *linems, *datam, *datams;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def626]
leptonica-1.87.0/src/correlscore.c:543:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘untouchable’
leptonica-1.87.0/src/correlscore.c:444:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:446:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:448:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/correlscore.c:450:9: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:450:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:454:5: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:457:8: branch_false: following ‘false’ branch (when ‘delw <= maxdiffw’)...
leptonica-1.87.0/src/correlscore.c:459:12: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:460:8: branch_false: following ‘false’ branch (when ‘delh <= maxdiffh’)...
leptonica-1.87.0/src/correlscore.c:464:8: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:491:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:497:5: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:521:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:525:21: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:527:12: branch_true: following ‘true’ branch (when ‘idelx == 0’)...
leptonica-1.87.0/src/correlscore.c:527:12: branch_true: ...to here
leptonica-1.87.0/src/correlscore.c:529:29: branch_true: following ‘true’ branch (when ‘y < hirow’)...
leptonica-1.87.0/src/correlscore.c:529:29: branch_true: ...to here
leptonica-1.87.0/src/correlscore.c:530:29: branch_false: following ‘false’ branch (when ‘x >= rowwords1’)...
leptonica-1.87.0/src/correlscore.c:542:20: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:542:20: branch_false: following ‘false’ branch (when ‘count < threshold’)...
leptonica-1.87.0/src/correlscore.c:543:38: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:543:21: danger: use of uninitialized value ‘untouchable’ here
#  541|                        * rows is below the threshold. */
#  542|                   if (count >= threshold) return TRUE;
#  543|->                 if (count + downcount[y] - untouchable < threshold) {
#  544|                       return FALSE;
#  545|                   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def627]
leptonica-1.87.0/src/correlscore.c:600:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘untouchable’
leptonica-1.87.0/src/correlscore.c:444:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:446:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:448:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/correlscore.c:450:9: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:450:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:454:5: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:457:8: branch_false: following ‘false’ branch (when ‘delw <= maxdiffw’)...
leptonica-1.87.0/src/correlscore.c:459:12: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:460:8: branch_false: following ‘false’ branch (when ‘delh <= maxdiffh’)...
leptonica-1.87.0/src/correlscore.c:464:8: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:491:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:497:5: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:521:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:525:21: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:527:12: branch_false: following ‘false’ branch (when ‘idelx != 0’)...
leptonica-1.87.0/src/correlscore.c:547:19: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:547:19: branch_true: following ‘true’ branch (when ‘idelx > 0’)...
leptonica-1.87.0/src/correlscore.c:564:16: branch_true: ...to here
leptonica-1.87.0/src/correlscore.c:564:16: branch_true: following ‘true’ branch (when ‘rowwords2 < rowwords1’)...
leptonica-1.87.0/src/correlscore.c:564:16: branch_true: ...to here
leptonica-1.87.0/src/correlscore.c:565:33: branch_true: following ‘true’ branch (when ‘y < hirow’)...
leptonica-1.87.0/src/correlscore.c:568:21: branch_true: ...to here
leptonica-1.87.0/src/correlscore.c:599:24: branch_false: following ‘false’ branch (when ‘threshold > count’)...
leptonica-1.87.0/src/correlscore.c:600:42: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:600:25: danger: use of uninitialized value ‘untouchable’ here
#  598|   
#  599|                       if (count >= threshold) return TRUE;
#  600|->                     if (count + downcount[y] - untouchable < threshold) {
#  601|                           return FALSE;
#  602|                       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def628]
leptonica-1.87.0/src/correlscore.c:631:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘untouchable’
leptonica-1.87.0/src/correlscore.c:444:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:446:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:448:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/correlscore.c:450:9: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:450:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:454:5: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:457:8: branch_false: following ‘false’ branch (when ‘delw <= maxdiffw’)...
leptonica-1.87.0/src/correlscore.c:459:12: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:460:8: branch_false: following ‘false’ branch (when ‘delh <= maxdiffh’)...
leptonica-1.87.0/src/correlscore.c:464:8: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:491:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:497:5: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:521:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:525:21: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:527:12: branch_false: following ‘false’ branch (when ‘idelx != 0’)...
leptonica-1.87.0/src/correlscore.c:547:19: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:547:19: branch_true: following ‘true’ branch (when ‘idelx > 0’)...
leptonica-1.87.0/src/correlscore.c:564:16: branch_true: ...to here
leptonica-1.87.0/src/correlscore.c:564:16: branch_false: following ‘false’ branch (when ‘rowwords2 >= rowwords1’)...
leptonica-1.87.0/src/correlscore.c:564:16: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:605:33: branch_true: following ‘true’ branch (when ‘y < hirow’)...
leptonica-1.87.0/src/correlscore.c:611:21: branch_true: ...to here
leptonica-1.87.0/src/correlscore.c:630:24: branch_false: following ‘false’ branch (when ‘count < threshold’)...
leptonica-1.87.0/src/correlscore.c:631:42: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:631:25: danger: use of uninitialized value ‘untouchable’ here
#  629|   
#  630|                       if (count >= threshold) return TRUE;
#  631|->                     if (count + downcount[y] - untouchable < threshold) {
#  632|                           return FALSE;
#  633|                       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def629]
leptonica-1.87.0/src/correlscore.c:658:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘untouchable’
leptonica-1.87.0/src/correlscore.c:444:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:446:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:448:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/correlscore.c:450:9: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:450:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:454:5: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:457:8: branch_false: following ‘false’ branch (when ‘delw <= maxdiffw’)...
leptonica-1.87.0/src/correlscore.c:459:12: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:460:8: branch_false: following ‘false’ branch (when ‘delh <= maxdiffh’)...
leptonica-1.87.0/src/correlscore.c:464:8: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:491:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:497:5: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:521:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:525:21: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:527:12: branch_false: following ‘false’ branch (when ‘idelx != 0’)...
leptonica-1.87.0/src/correlscore.c:547:19: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:547:19: branch_false: following ‘false’ branch (when ‘idelx <= 0’)...
leptonica-1.87.0/src/correlscore.c:642:16: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:642:16: branch_true: following ‘true’ branch (when ‘rowwords2 > rowwords1’)...
leptonica-1.87.0/src/correlscore.c:642:16: branch_true: ...to here
leptonica-1.87.0/src/correlscore.c:645:33: branch_true: following ‘true’ branch (when ‘y < hirow’)...
leptonica-1.87.0/src/correlscore.c:645:33: branch_true: ...to here
leptonica-1.87.0/src/correlscore.c:646:33: branch_false: following ‘false’ branch (when ‘x >= rowwords1’)...
leptonica-1.87.0/src/correlscore.c:657:24: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:657:24: branch_false: following ‘false’ branch (when ‘count < threshold’)...
leptonica-1.87.0/src/correlscore.c:658:42: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:658:25: danger: use of uninitialized value ‘untouchable’ here
#  656|   
#  657|                       if (count >= threshold) return TRUE;
#  658|->                     if (count + downcount[y] - untouchable < threshold) {
#  659|                           return FALSE;
#  660|                       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def630]
leptonica-1.87.0/src/correlscore.c:686:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘untouchable’
leptonica-1.87.0/src/correlscore.c:444:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:446:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:448:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/correlscore.c:450:9: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:450:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:454:5: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:457:8: branch_false: following ‘false’ branch (when ‘delw <= maxdiffw’)...
leptonica-1.87.0/src/correlscore.c:459:12: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:460:8: branch_false: following ‘false’ branch (when ‘delh <= maxdiffh’)...
leptonica-1.87.0/src/correlscore.c:464:8: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:491:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:497:5: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:521:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/correlscore.c:525:21: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:527:12: branch_false: following ‘false’ branch (when ‘idelx != 0’)...
leptonica-1.87.0/src/correlscore.c:547:19: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:547:19: branch_false: following ‘false’ branch (when ‘idelx <= 0’)...
leptonica-1.87.0/src/correlscore.c:642:16: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:642:16: branch_false: following ‘false’ branch (when ‘rowwords2 <= rowwords1’)...
leptonica-1.87.0/src/correlscore.c:642:16: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:665:33: branch_true: following ‘true’ branch (when ‘y < hirow’)...
leptonica-1.87.0/src/correlscore.c:665:33: branch_true: ...to here
leptonica-1.87.0/src/correlscore.c:685:24: branch_false: following ‘false’ branch (when ‘threshold > count’)...
leptonica-1.87.0/src/correlscore.c:686:42: branch_false: ...to here
leptonica-1.87.0/src/correlscore.c:686:25: danger: use of uninitialized value ‘untouchable’ here
#  684|   
#  685|                       if (count >= threshold) return TRUE;
#  686|->                     if (count + downcount[y] - untouchable < threshold) {
#  687|                           return FALSE;
#  688|                       }

Error: COMPILER_WARNING (CWE-457): [#def631]
leptonica-1.87.0/src/correlscore.c: scope_hint: In function ‘pixCorrelationScoreThresholded’
leptonica-1.87.0/src/correlscore.c:686:46: warning[-Wmaybe-uninitialized]: ‘untouchable’ may be used uninitialized
#  686 |                     if (count + downcount[y] - untouchable < threshold) {
#      |                         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
leptonica-1.87.0/src/correlscore.c:437:52: note: ‘untouchable’ was declared here
#  437 | l_int32    wpl1, wpl2, lorow, hirow, locol, hicol, untouchable;
#      |                                                    ^~~~~~~~~~~
#  684|   
#  685|                       if (count >= threshold) return TRUE;
#  686|->                     if (count + downcount[y] - untouchable < threshold) {
#  687|                           return FALSE;
#  688|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def632]
leptonica-1.87.0/src/dewarp1.c:470: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
#  468|   
#  469|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
#  470|->     dew->pixs = pixClone(pixs);
#  471|       dew->pageno = pageno;
#  472|       dew->w = pixGetWidth(pixs);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def633]
leptonica-1.87.0/src/dewarp1.c:470:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dew’
leptonica-1.87.0/src/dewarp1.c:466:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:469:23: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:469:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/dewarp1.c:470:5: danger: ‘dew’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  468|   
#  469|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
#  470|->     dew->pixs = pixClone(pixs);
#  471|       dew->pageno = pageno;
#  472|       dew->w = pixGetWidth(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def634]
leptonica-1.87.0/src/dewarp1.c:470:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dew’
leptonica-1.87.0/src/dewarp1.c:466:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:469:23: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:469:23: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:470:17: throw: if ‘pixClone’ throws an exception...
leptonica-1.87.0/src/dewarp1.c:470:17: danger: ‘dew’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  468|   
#  469|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
#  470|->     dew->pixs = pixClone(pixs);
#  471|       dew->pageno = pageno;
#  472|       dew->w = pixGetWidth(pixs);

Error: CPPCHECK_WARNING (CWE-476): [#def635]
leptonica-1.87.0/src/dewarp1.c:471: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
#  469|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
#  470|       dew->pixs = pixClone(pixs);
#  471|->     dew->pageno = pageno;
#  472|       dew->w = pixGetWidth(pixs);
#  473|       dew->h = pixGetHeight(pixs);

Error: CPPCHECK_WARNING (CWE-476): [#def636]
leptonica-1.87.0/src/dewarp1.c:472: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
#  470|       dew->pixs = pixClone(pixs);
#  471|       dew->pageno = pageno;
#  472|->     dew->w = pixGetWidth(pixs);
#  473|       dew->h = pixGetHeight(pixs);
#  474|       return dew;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def637]
leptonica-1.87.0/src/dewarp1.c:472:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dew’
leptonica-1.87.0/src/dewarp1.c:466:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:469:23: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:469:23: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:472:14: throw: if ‘pixGetWidth’ throws an exception...
leptonica-1.87.0/src/dewarp1.c:472:14: danger: ‘dew’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  470|       dew->pixs = pixClone(pixs);
#  471|       dew->pageno = pageno;
#  472|->     dew->w = pixGetWidth(pixs);
#  473|       dew->h = pixGetHeight(pixs);
#  474|       return dew;

Error: CPPCHECK_WARNING (CWE-476): [#def638]
leptonica-1.87.0/src/dewarp1.c:473: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
#  471|       dew->pageno = pageno;
#  472|       dew->w = pixGetWidth(pixs);
#  473|->     dew->h = pixGetHeight(pixs);
#  474|       return dew;
#  475|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def639]
leptonica-1.87.0/src/dewarp1.c:473:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dew’
leptonica-1.87.0/src/dewarp1.c:466:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:469:23: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:469:23: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:473:14: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/dewarp1.c:473:14: danger: ‘dew’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  471|       dew->pageno = pageno;
#  472|       dew->w = pixGetWidth(pixs);
#  473|->     dew->h = pixGetHeight(pixs);
#  474|       return dew;
#  475|   }

Error: CPPCHECK_WARNING (CWE-476): [#def640]
leptonica-1.87.0/src/dewarp1.c:502: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
#  500|   
#  501|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
#  502|->     dew->pageno = pageno;
#  503|       dew->hasref = 1;
#  504|       dew->refpage = refpage;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def641]
leptonica-1.87.0/src/dewarp1.c:502:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dew’
leptonica-1.87.0/src/dewarp1.c:501:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/dewarp1.c:502:5: danger: ‘dew’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  500|   
#  501|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
#  502|->     dew->pageno = pageno;
#  503|       dew->hasref = 1;
#  504|       dew->refpage = refpage;

Error: CPPCHECK_WARNING (CWE-476): [#def642]
leptonica-1.87.0/src/dewarp1.c:503: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
#  501|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
#  502|       dew->pageno = pageno;
#  503|->     dew->hasref = 1;
#  504|       dew->refpage = refpage;
#  505|       return dew;

Error: CPPCHECK_WARNING (CWE-476): [#def643]
leptonica-1.87.0/src/dewarp1.c:504: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
#  502|       dew->pageno = pageno;
#  503|       dew->hasref = 1;
#  504|->     dew->refpage = refpage;
#  505|       return dew;
#  506|   }

Error: CPPCHECK_WARNING (CWE-476): [#def644]
leptonica-1.87.0/src/dewarp1.c:609: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dewa
#  607|   
#  608|       dewa = (L_DEWARPA *)LEPT_CALLOC(1, sizeof(L_DEWARPA));
#  609|->     dewa->dewarp = (L_DEWARP **)LEPT_CALLOC(nptrs, sizeof(L_DEWARPA *));
#  610|       dewa->dewarpcache = (L_DEWARP **)LEPT_CALLOC(nptrs, sizeof(L_DEWARPA *));
#  611|       if (!dewa->dewarp || !dewa->dewarpcache) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def645]
leptonica-1.87.0/src/dewarp1.c:609:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dewa’
leptonica-1.87.0/src/dewarp1.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:591:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:608:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/dewarp1.c:609:5: danger: ‘calloc(1, 96)’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  607|   
#  608|       dewa = (L_DEWARPA *)LEPT_CALLOC(1, sizeof(L_DEWARPA));
#  609|->     dewa->dewarp = (L_DEWARP **)LEPT_CALLOC(nptrs, sizeof(L_DEWARPA *));
#  610|       dewa->dewarpcache = (L_DEWARP **)LEPT_CALLOC(nptrs, sizeof(L_DEWARPA *));
#  611|       if (!dewa->dewarp || !dewa->dewarpcache) {

Error: CPPCHECK_WARNING (CWE-476): [#def646]
leptonica-1.87.0/src/dewarp1.c:610: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dewa
#  608|       dewa = (L_DEWARPA *)LEPT_CALLOC(1, sizeof(L_DEWARPA));
#  609|       dewa->dewarp = (L_DEWARP **)LEPT_CALLOC(nptrs, sizeof(L_DEWARPA *));
#  610|->     dewa->dewarpcache = (L_DEWARP **)LEPT_CALLOC(nptrs, sizeof(L_DEWARPA *));
#  611|       if (!dewa->dewarp || !dewa->dewarpcache) {
#  612|           dewarpaDestroy(&dewa);

Error: CPPCHECK_WARNING (CWE-476): [#def647]
leptonica-1.87.0/src/dewarp1.c:611: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dewa
#  609|       dewa->dewarp = (L_DEWARP **)LEPT_CALLOC(nptrs, sizeof(L_DEWARPA *));
#  610|       dewa->dewarpcache = (L_DEWARP **)LEPT_CALLOC(nptrs, sizeof(L_DEWARPA *));
#  611|->     if (!dewa->dewarp || !dewa->dewarpcache) {
#  612|           dewarpaDestroy(&dewa);
#  613|           return (L_DEWARPA *)ERROR_PTR("dewarp ptrs not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def648]
leptonica-1.87.0/src/dewarp1.c:741:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/dewarp1.c:576:1: enter_function: entry to ‘dewarpaCreate’
leptonica-1.87.0/src/dewarp1.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:591:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:610:38: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:611:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/dewarp1.c:612:9: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:612:9: call_function: calling ‘dewarpaDestroy’ from ‘dewarpaCreate’
#  739|               dewarpDestroy(&dew);
#  740|       }
#  741|->     numaDestroy(&dewa->namodels);
#  742|       numaDestroy(&dewa->napages);
#  743|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def649]
leptonica-1.87.0/src/dewarp1.c:741:5: warning[-Wanalyzer-malloc-leak]: leak of ‘dewa’
leptonica-1.87.0/src/dewarp1.c:576:1: enter_function: entry to ‘dewarpaCreate’
leptonica-1.87.0/src/dewarp1.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:591:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:608:25: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:611:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/dewarp1.c:612:9: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:612:9: call_function: calling ‘dewarpaDestroy’ from ‘dewarpaCreate’
#  739|               dewarpDestroy(&dew);
#  740|       }
#  741|->     numaDestroy(&dewa->namodels);
#  742|       numaDestroy(&dewa->napages);
#  743|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def650]
leptonica-1.87.0/src/dewarp1.c:901:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/dewarp1.c:1637:1: enter_function: entry to ‘dewarpaWriteMem’
leptonica-1.87.0/src/dewarp1.c:1645:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1645:16: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:1646:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: following ‘false’ branch (when ‘dewa’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1654:15: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1654:15: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:1654:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1656:11: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1656:11: call_function: calling ‘dewarpaWriteStream’ from ‘dewarpaWriteMem’
#  899|           return (L_DEWARP *)ERROR_PTR("dewa not defined", __func__, NULL);
#  900|       if (index < 0 || index > dewa->maxpage) {
#  901|->         L_ERROR("index = %d is invalid; max index = %d\n",
#  902|                   __func__, index, dewa->maxpage);
#  903|           return NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def651]
leptonica-1.87.0/src/dewarp1.c:1210: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1208|   
# 1209|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
# 1210|->     dew->w = w;
# 1211|       dew->h = h;
# 1212|       dew->pageno = pageno;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def652]
leptonica-1.87.0/src/dewarp1.c:1210:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dew’
leptonica-1.87.0/src/dewarp1.c:1158:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1160:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1160:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1162:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1162:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1164:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1164:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1167:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1167:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1171:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1171:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1174:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1174:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1176:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1176:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1178:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1178:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1181:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1197:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1202:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1202:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp1.c:1207:5: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1209:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/dewarp1.c:1210:5: danger: ‘dew’ could be NULL: unchecked value from [(23)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/22)
# 1208|   
# 1209|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
# 1210|->     dew->w = w;
# 1211|       dew->h = h;
# 1212|       dew->pageno = pageno;

Error: CPPCHECK_WARNING (CWE-476): [#def653]
leptonica-1.87.0/src/dewarp1.c:1211: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1209|       dew = (L_DEWARP *)LEPT_CALLOC(1, sizeof(L_DEWARP));
# 1210|       dew->w = w;
# 1211|->     dew->h = h;
# 1212|       dew->pageno = pageno;
# 1213|       dew->sampling = sampling;

Error: CPPCHECK_WARNING (CWE-476): [#def654]
leptonica-1.87.0/src/dewarp1.c:1212: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1210|       dew->w = w;
# 1211|       dew->h = h;
# 1212|->     dew->pageno = pageno;
# 1213|       dew->sampling = sampling;
# 1214|       dew->redfactor = redfactor;

Error: CPPCHECK_WARNING (CWE-476): [#def655]
leptonica-1.87.0/src/dewarp1.c:1213: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1211|       dew->h = h;
# 1212|       dew->pageno = pageno;
# 1213|->     dew->sampling = sampling;
# 1214|       dew->redfactor = redfactor;
# 1215|       dew->minlines = minlines;

Error: CPPCHECK_WARNING (CWE-476): [#def656]
leptonica-1.87.0/src/dewarp1.c:1214: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1212|       dew->pageno = pageno;
# 1213|       dew->sampling = sampling;
# 1214|->     dew->redfactor = redfactor;
# 1215|       dew->minlines = minlines;
# 1216|       dew->nlines = nlines;

Error: CPPCHECK_WARNING (CWE-476): [#def657]
leptonica-1.87.0/src/dewarp1.c:1215: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1213|       dew->sampling = sampling;
# 1214|       dew->redfactor = redfactor;
# 1215|->     dew->minlines = minlines;
# 1216|       dew->nlines = nlines;
# 1217|       dew->hasref = hasref;

Error: CPPCHECK_WARNING (CWE-476): [#def658]
leptonica-1.87.0/src/dewarp1.c:1216: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1214|       dew->redfactor = redfactor;
# 1215|       dew->minlines = minlines;
# 1216|->     dew->nlines = nlines;
# 1217|       dew->hasref = hasref;
# 1218|       dew->refpage = refpage;

Error: CPPCHECK_WARNING (CWE-476): [#def659]
leptonica-1.87.0/src/dewarp1.c:1217: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1215|       dew->minlines = minlines;
# 1216|       dew->nlines = nlines;
# 1217|->     dew->hasref = hasref;
# 1218|       dew->refpage = refpage;
# 1219|       if (hasref == 0)  /* any dew without a ref has an actual model */

Error: CPPCHECK_WARNING (CWE-476): [#def660]
leptonica-1.87.0/src/dewarp1.c:1218: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1216|       dew->nlines = nlines;
# 1217|       dew->hasref = hasref;
# 1218|->     dew->refpage = refpage;
# 1219|       if (hasref == 0)  /* any dew without a ref has an actual model */
# 1220|           dew->vsuccess = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def661]
leptonica-1.87.0/src/dewarp1.c:1221: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1219|       if (hasref == 0)  /* any dew without a ref has an actual model */
# 1220|           dew->vsuccess = 1;
# 1221|->     dew->nx = nx;
# 1222|       dew->ny = ny;
# 1223|       if (vdispar) {

Error: CPPCHECK_WARNING (CWE-476): [#def662]
leptonica-1.87.0/src/dewarp1.c:1222: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dew
# 1220|           dew->vsuccess = 1;
# 1221|       dew->nx = nx;
# 1222|->     dew->ny = ny;
# 1223|       if (vdispar) {
# 1224|           dew->mincurv = mincurv;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def663]
leptonica-1.87.0/src/dewarp1.c:1320:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/dewarp1.c:1637:1: enter_function: entry to ‘dewarpaWriteMem’
leptonica-1.87.0/src/dewarp1.c:1645:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1645:16: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:1646:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: following ‘false’ branch (when ‘dewa’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1654:15: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1654:15: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:1654:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1656:11: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1656:11: call_function: calling ‘dewarpaWriteStream’ from ‘dewarpaWriteMem’
# 1318|           return ERROR_INT("stream not defined", __func__, 1);
# 1319|       if (!dew)
# 1320|->         return ERROR_INT("dew not defined", __func__, 1);
# 1321|   
# 1322|       fprintf(fp, "\nDewarp Version %d\n", DEWARP_VERSION_NUMBER);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def664]
leptonica-1.87.0/src/dewarp1.c:1342:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/dewarp1.c:1366:1: enter_function: entry to ‘dewarpWriteMem’
leptonica-1.87.0/src/dewarp1.c:1374:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1374:16: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:1375:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1377:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1377:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1379:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1379:8: branch_false: following ‘false’ branch (when ‘dew’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1383:15: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1383:15: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:1383:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1385:11: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1385:11: call_function: calling ‘dewarpWriteStream’ from ‘dewarpWriteMem’
# 1340|                   dew->leftcurv, dew->rightcurv);
# 1341|       }
# 1342|->     if (vdispar) fpixWriteStream(fp, dew->sampvdispar);
# 1343|       if (hdispar) fpixWriteStream(fp, dew->samphdispar);
# 1344|       fprintf(fp, "\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def665]
leptonica-1.87.0/src/dewarp1.c:1343:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/dewarp1.c:1366:1: enter_function: entry to ‘dewarpWriteMem’
leptonica-1.87.0/src/dewarp1.c:1374:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1374:16: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:1375:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1377:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1377:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1379:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1379:8: branch_false: following ‘false’ branch (when ‘dew’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1383:15: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1383:15: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:1383:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1385:11: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1385:11: call_function: calling ‘dewarpWriteStream’ from ‘dewarpWriteMem’
# 1341|       }
# 1342|       if (vdispar) fpixWriteStream(fp, dew->sampvdispar);
# 1343|->     if (hdispar) fpixWriteStream(fp, dew->samphdispar);
# 1344|       fprintf(fp, "\n");
# 1345|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def666]
leptonica-1.87.0/src/dewarp1.c:1347:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/dewarp1.c:1366:1: enter_function: entry to ‘dewarpWriteMem’
leptonica-1.87.0/src/dewarp1.c:1374:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1374:16: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:1375:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1377:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1377:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1379:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1379:8: branch_false: following ‘false’ branch (when ‘dew’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1383:15: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1383:15: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:1383:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1385:11: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1385:11: call_function: calling ‘dewarpWriteStream’ from ‘dewarpWriteMem’
# 1345|   
# 1346|       if (!vdispar)
# 1347|->         L_WARNING("no disparity arrays!\n", __func__);
# 1348|       return 0;
# 1349|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def667]
leptonica-1.87.0/src/dewarp1.c:1598:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/dewarp1.c:1637:1: enter_function: entry to ‘dewarpaWriteMem’
leptonica-1.87.0/src/dewarp1.c:1645:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1645:16: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:1646:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: following ‘false’ branch (when ‘dewa’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1654:15: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1654:15: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:1654:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1656:11: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1656:11: call_function: calling ‘dewarpaWriteStream’ from ‘dewarpaWriteMem’
# 1596|            * using the model to remove the warping, which typically
# 1597|            * can happen later, after all the models have been built. */
# 1598|->     dewarpaListPages(dewa);
# 1599|       if (!dewa->namodels)
# 1600|           return ERROR_INT("dewa->namodels not made", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def668]
leptonica-1.87.0/src/dewarp1.c:1600:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/dewarp1.c:1637:1: enter_function: entry to ‘dewarpaWriteMem’
leptonica-1.87.0/src/dewarp1.c:1645:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1645:16: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:1646:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: following ‘false’ branch (when ‘dewa’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1654:15: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1654:15: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:1654:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1656:11: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1656:11: call_function: calling ‘dewarpaWriteStream’ from ‘dewarpaWriteMem’
# 1598|       dewarpaListPages(dewa);
# 1599|       if (!dewa->namodels)
# 1600|->         return ERROR_INT("dewa->namodels not made", __func__, 1);
# 1601|       ndewarp = numaGetCount(dewa->namodels);  /*  with actual page models */
# 1602|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def669]
leptonica-1.87.0/src/dewarp1.c:1601:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/dewarp1.c:1637:1: enter_function: entry to ‘dewarpaWriteMem’
leptonica-1.87.0/src/dewarp1.c:1645:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1645:16: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:1646:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: following ‘false’ branch (when ‘dewa’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1654:15: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1654:15: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:1654:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1656:11: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1656:11: call_function: calling ‘dewarpaWriteStream’ from ‘dewarpaWriteMem’
# 1599|       if (!dewa->namodels)
# 1600|           return ERROR_INT("dewa->namodels not made", __func__, 1);
# 1601|->     ndewarp = numaGetCount(dewa->namodels);  /*  with actual page models */
# 1602|   
# 1603|       fprintf(fp, "\nDewarpa Version %d\n", DEWARP_VERSION_NUMBER);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def670]
leptonica-1.87.0/src/dewarp1.c:1615:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/dewarp1.c:1637:1: enter_function: entry to ‘dewarpaWriteMem’
leptonica-1.87.0/src/dewarp1.c:1645:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1645:16: branch_true: ...to here
leptonica-1.87.0/src/dewarp1.c:1646:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1648:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1650:8: branch_false: following ‘false’ branch (when ‘dewa’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1654:15: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1654:15: acquire_memory: allocated here
leptonica-1.87.0/src/dewarp1.c:1654:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/dewarp1.c:1656:11: branch_false: ...to here
leptonica-1.87.0/src/dewarp1.c:1656:11: call_function: calling ‘dewarpaWriteStream’ from ‘dewarpaWriteMem’
# 1613|       fprintf(fp, "fullmodel = %d\n", dewa->useboth);
# 1614|       for (i = 0; i < ndewarp; i++) {
# 1615|->         numaGetIValue(dewa->namodels, i, &pageno);
# 1616|           dewarpWriteStream(fp, dewarpaGetDewarp(dewa, pageno));
# 1617|       }

Error: CPPCHECK_WARNING (CWE-457): [#def671]
leptonica-1.87.0/src/dewarp2.c:1316: warning[uninitvar]: Uninitialized variable: ytop
# 1314|       *pntop = ntop;
# 1315|       *pnbot = nbot;
# 1316|->     *pytop = ytop;
# 1317|       *pybot = ybot;
# 1318|       nmin = 4;  /* minimum number of lines required in each half */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def672]
leptonica-1.87.0/src/dewarp2.c:1316:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ytop’
leptonica-1.87.0/src/dewarp2.c:1288:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/dewarp2.c:1290:14: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1290:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp2.c:1292:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1292:8: branch_false: following ‘false’ branch (when ‘h > 0’)...
leptonica-1.87.0/src/dewarp2.c:1294:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1294:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp2.c:1296:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1296:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp2.c:1299:10: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1305:27: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp2.c:1312:5: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1316:5: danger: use of uninitialized value ‘ytop’ here
# 1314|       *pntop = ntop;
# 1315|       *pnbot = nbot;
# 1316|->     *pytop = ytop;
# 1317|       *pybot = ybot;
# 1318|       nmin = 4;  /* minimum number of lines required in each half */

Error: CPPCHECK_WARNING (CWE-457): [#def673]
leptonica-1.87.0/src/dewarp2.c:1317: warning[uninitvar]: Uninitialized variable: ybot
# 1315|       *pnbot = nbot;
# 1316|       *pytop = ytop;
# 1317|->     *pybot = ybot;
# 1318|       nmin = 4;  /* minimum number of lines required in each half */
# 1319|       both_halves = (ntop >= nmin) && (nbot >= nmin);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def674]
leptonica-1.87.0/src/dewarp2.c:1317:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ybot’
leptonica-1.87.0/src/dewarp2.c:1288:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/dewarp2.c:1290:14: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1290:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp2.c:1292:8: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1292:8: branch_false: following ‘false’ branch (when ‘h > 0’)...
leptonica-1.87.0/src/dewarp2.c:1294:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1294:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp2.c:1296:9: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1296:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp2.c:1299:10: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1305:27: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/dewarp2.c:1306:9: branch_true: ...to here
leptonica-1.87.0/src/dewarp2.c:1307:12: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/dewarp2.c:1307:21: branch_true: ...to here
leptonica-1.87.0/src/dewarp2.c:1308:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp2.c:1309:13: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1309:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/dewarp2.c:1310:13: branch_true: ...to here
leptonica-1.87.0/src/dewarp2.c:1305:27: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dewarp2.c:1312:5: branch_false: ...to here
leptonica-1.87.0/src/dewarp2.c:1317:5: danger: use of uninitialized value ‘ybot’ here
# 1315|       *pnbot = nbot;
# 1316|       *pytop = ytop;
# 1317|->     *pybot = ybot;
# 1318|       nmin = 4;  /* minimum number of lines required in each half */
# 1319|       both_halves = (ntop >= nmin) && (nbot >= nmin);

Error: COMPILER_WARNING (CWE-457): [#def675]
leptonica-1.87.0/src/dewarp2.c:1320:33: warning[-Wmaybe-uninitialized]: ‘ybot’ may be used uninitialized
# 1320 |     fraction = (l_float32)(ybot - ytop) / (l_float32)h;
#      |                           ~~~~~~^~~~~~~
leptonica-1.87.0/src/dewarp2.c: scope_hint: In function ‘dewarpBuildPageModel’
leptonica-1.87.0/src/dewarp2.c:1284:53: note: ‘ybot’ was declared here
# 1284 | l_int32    i, n, iy, both_halves, ntop, nbot, ytop, ybot, nmin;
#      |                                                     ^~~~
# 1318|       nmin = 4;  /* minimum number of lines required in each half */
# 1319|       both_halves = (ntop >= nmin) && (nbot >= nmin);
# 1320|->     fraction = (l_float32)(ybot - ytop) / (l_float32)h;
# 1321|       if (both_halves && fraction > 0.50)
# 1322|           return 1;

Error: CPPCHECK_WARNING (CWE-476): [#def676]
leptonica-1.87.0/src/dnabasic.c:187: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: da
#  185|   
#  186|       da = (L_DNA *)LEPT_CALLOC(1, sizeof(L_DNA));
#  187|->     if ((da->array = (l_float64 *)LEPT_CALLOC(n, sizeof(l_float64))) == NULL) {
#  188|           l_dnaDestroy(&da);
#  189|           return (L_DNA *)ERROR_PTR("double array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def677]
leptonica-1.87.0/src/dnabasic.c:187:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘da’
leptonica-1.87.0/src/dnabasic.c:357:1: enter_function: entry to ‘l_dnaCopy’
leptonica-1.87.0/src/dnabasic.c:365:16: call_function: calling ‘l_dnaCreate’ from ‘l_dnaCopy’
#  185|   
#  186|       da = (L_DNA *)LEPT_CALLOC(1, sizeof(L_DNA));
#  187|->     if ((da->array = (l_float64 *)LEPT_CALLOC(n, sizeof(l_float64))) == NULL) {
#  188|           l_dnaDestroy(&da);
#  189|           return (L_DNA *)ERROR_PTR("double array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def678]
leptonica-1.87.0/src/dnabasic.c:192: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: da
#  190|       }
#  191|   
#  192|->     da->nalloc = n;
#  193|       da->n = 0;
#  194|       da->refcount = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def679]
leptonica-1.87.0/src/dnabasic.c:193: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: da
#  191|   
#  192|       da->nalloc = n;
#  193|->     da->n = 0;
#  194|       da->refcount = 1;
#  195|       da->startx = 0.0;

Error: CPPCHECK_WARNING (CWE-476): [#def680]
leptonica-1.87.0/src/dnabasic.c:194: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: da
#  192|       da->nalloc = n;
#  193|       da->n = 0;
#  194|->     da->refcount = 1;
#  195|       da->startx = 0.0;
#  196|       da->delx = 1.0;

Error: CPPCHECK_WARNING (CWE-476): [#def681]
leptonica-1.87.0/src/dnabasic.c:195: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: da
#  193|       da->n = 0;
#  194|       da->refcount = 1;
#  195|->     da->startx = 0.0;
#  196|       da->delx = 1.0;
#  197|   

Error: CPPCHECK_WARNING (CWE-476): [#def682]
leptonica-1.87.0/src/dnabasic.c:196: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: da
#  194|       da->refcount = 1;
#  195|       da->startx = 0.0;
#  196|->     da->delx = 1.0;
#  197|   
#  198|       return da;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def683]
leptonica-1.87.0/src/dnabasic.c:342:1: warning[-Wanalyzer-malloc-leak]: leak of ‘da’
leptonica-1.87.0/src/dnabasic.c:357:1: enter_function: entry to ‘l_dnaCopy’
leptonica-1.87.0/src/dnabasic.c:365:16: call_function: calling ‘l_dnaCreate’ from ‘l_dnaCopy’
#  340|       }
#  341|       *pda = NULL;
#  342|-> }
#  343|   
#  344|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def684]
leptonica-1.87.0/src/dnabasic.c:387:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/dnabasic.c:1768:1: enter_function: entry to ‘l_dnaaWriteMem’
leptonica-1.87.0/src/dnabasic.c:1776:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dnabasic.c:1776:16: branch_true: ...to here
leptonica-1.87.0/src/dnabasic.c:1777:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/dnabasic.c:1779:8: branch_false: ...to here
leptonica-1.87.0/src/dnabasic.c:1779:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/dnabasic.c:1781:8: branch_false: ...to here
leptonica-1.87.0/src/dnabasic.c:1781:8: branch_false: following ‘false’ branch (when ‘daa’ is non-NULL)...
leptonica-1.87.0/src/dnabasic.c:1785:15: branch_false: ...to here
leptonica-1.87.0/src/dnabasic.c:1785:15: acquire_memory: allocated here
leptonica-1.87.0/src/dnabasic.c:1785:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/dnabasic.c:1787:11: branch_false: ...to here
leptonica-1.87.0/src/dnabasic.c:1787:11: call_function: calling ‘l_dnaaWriteStream’ from ‘l_dnaaWriteMem’
#  385|   {
#  386|       if (!da)
#  387|->         return (L_DNA *)ERROR_PTR("da not defined", __func__, NULL);
#  388|   
#  389|       ++da->refcount;

Error: CPPCHECK_WARNING (CWE-476): [#def685]
leptonica-1.87.0/src/dnabasic.c:1194: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: daa
# 1192|   
# 1193|       daa = (L_DNAA *)LEPT_CALLOC(1, sizeof(L_DNAA));
# 1194|->     if ((daa->dna = (L_DNA **)LEPT_CALLOC(n, sizeof(L_DNA *))) == NULL) {
# 1195|           l_dnaaDestroy(&daa);
# 1196|           return (L_DNAA *)ERROR_PTR("l_dna ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def686]
leptonica-1.87.0/src/dnabasic.c:1194:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘daa’
leptonica-1.87.0/src/dnabasic.c:1625:1: enter_function: entry to ‘l_dnaaReadStream’
leptonica-1.87.0/src/dnabasic.c:1635:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dnabasic.c:1637:9: branch_false: ...to here
leptonica-1.87.0/src/dnabasic.c:1637:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dnabasic.c:1639:9: branch_false: ...to here
leptonica-1.87.0/src/dnabasic.c:1639:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dnabasic.c:1641:9: branch_false: ...to here
leptonica-1.87.0/src/dnabasic.c:1641:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dnabasic.c:1643:9: branch_false: ...to here
leptonica-1.87.0/src/dnabasic.c:1643:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dnabasic.c:1645:8: branch_false: ...to here
leptonica-1.87.0/src/dnabasic.c:1647:16: call_function: calling ‘l_dnaaCreate’ from ‘l_dnaaReadStream’
# 1192|   
# 1193|       daa = (L_DNAA *)LEPT_CALLOC(1, sizeof(L_DNAA));
# 1194|->     if ((daa->dna = (L_DNA **)LEPT_CALLOC(n, sizeof(L_DNA *))) == NULL) {
# 1195|           l_dnaaDestroy(&daa);
# 1196|           return (L_DNAA *)ERROR_PTR("l_dna ptr array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def687]
leptonica-1.87.0/src/dnabasic.c:1198: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: daa
# 1196|           return (L_DNAA *)ERROR_PTR("l_dna ptr array not made", __func__, NULL);
# 1197|       }
# 1198|->     daa->nalloc = n;
# 1199|       daa->n = 0;
# 1200|       return daa;

Error: CPPCHECK_WARNING (CWE-476): [#def688]
leptonica-1.87.0/src/dnabasic.c:1199: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: daa
# 1197|       }
# 1198|       daa->nalloc = n;
# 1199|->     daa->n = 0;
# 1200|       return daa;
# 1201|   }

Error: CPPCHECK_WARNING (CWE-476): [#def689]
leptonica-1.87.0/src/dnahash.c:85: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dahash
#   83|   
#   84|       dahash = (L_DNAHASH *)LEPT_CALLOC(1, sizeof(L_DNAHASH));
#   85|->     if ((dahash->dna = (L_DNA **)LEPT_CALLOC(nbuckets, sizeof(L_DNA *)))
#   86|           == NULL) {
#   87|           LEPT_FREE(dahash);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def690]
leptonica-1.87.0/src/dnahash.c:85:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dahash’
leptonica-1.87.0/src/dnahash.c:76:8: branch_false: following ‘false’ branch (when ‘nbuckets > 0’)...
leptonica-1.87.0/src/dnahash.c:78:5: branch_false: ...to here
leptonica-1.87.0/src/dnahash.c:79:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/dnahash.c:84:27: branch_false: ...to here
leptonica-1.87.0/src/dnahash.c:84:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/dnahash.c:85:9: danger: ‘dahash’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   83|   
#   84|       dahash = (L_DNAHASH *)LEPT_CALLOC(1, sizeof(L_DNAHASH));
#   85|->     if ((dahash->dna = (L_DNA **)LEPT_CALLOC(nbuckets, sizeof(L_DNA *)))
#   86|           == NULL) {
#   87|           LEPT_FREE(dahash);

Error: CPPCHECK_WARNING (CWE-476): [#def691]
leptonica-1.87.0/src/dnahash.c:91: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dahash
#   89|       }
#   90|   
#   91|->     dahash->nbuckets = nbuckets;
#   92|       dahash->initsize = initsize;
#   93|       return dahash;

Error: CPPCHECK_WARNING (CWE-476): [#def692]
leptonica-1.87.0/src/dnahash.c:92: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dahash
#   90|   
#   91|       dahash->nbuckets = nbuckets;
#   92|->     dahash->initsize = initsize;
#   93|       return dahash;
#   94|   }

Error: CPPCHECK_WARNING (CWE-476): [#def693]
leptonica-1.87.0/src/encoding.c:290: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rtable64
#  288|       rtable64 = (l_int32 *)LEPT_CALLOC(128, sizeof(l_int32));
#  289|       for (i = 0; i < 64; i++) {
#  290|->         rtable64[(unsigned char)tablechar64[i]] = i;
#  291|       }
#  292|       return rtable64;

Error: GCC_ANALYZER_WARNING: [#def694]
leptonica-1.87.0/src/encoding.c:362:26: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.87.0/src/encoding.c:351:8: branch_false: following ‘false’ branch (when ‘poutsize’ is non-NULL)...
leptonica-1.87.0/src/encoding.c:353:5: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:354:8: branch_false: following ‘false’ branch (when ‘inarray’ is non-NULL)...
leptonica-1.87.0/src/encoding.c:356:8: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:356:8: branch_false: following ‘false’ branch (when ‘insize != 0’)...
leptonica-1.87.0/src/encoding.c:360:32: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:362:26: danger: operand ‘5.0e+0’ is of type ‘double’
#  360|       maxsize = (l_int32)(80. + (insize * 5. / 4.) *
#  361|                           (1. + 2. / MAX_ASCII85_LINE));
#  362|->     if ((chara = (char *)LEPT_CALLOC(maxsize, sizeof(char))) == NULL)
#  363|           return (char *)ERROR_PTR("chara not made", __func__, NULL);
#  364|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def695]
leptonica-1.87.0/src/encoding.c:495:32: warning[-Wanalyzer-malloc-leak]: leak of ‘decodeAscii85(instr,  insize, & size1)’
leptonica-1.87.0/src/encoding.c:617:1: enter_function: entry to ‘decodeAscii85WithComp’
leptonica-1.87.0/src/encoding.c:624:8: branch_false: following ‘false’ branch (when ‘poutsize’ is non-NULL)...
leptonica-1.87.0/src/encoding.c:626:5: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:627:8: branch_false: following ‘false’ branch (when ‘instr’ is non-NULL)...
leptonica-1.87.0/src/encoding.c:630:8: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:631:18: call_function: calling ‘decodeAscii85’ from ‘decodeAscii85WithComp’
leptonica-1.87.0/src/encoding.c:631:18: return_function: returning to ‘decodeAscii85WithComp’ from ‘decodeAscii85’
leptonica-1.87.0/src/encoding.c:631:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/encoding.c:633:15: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:633:15: throw: if ‘zlibUncompress’ throws an exception...
leptonica-1.87.0/src/encoding.c:495:32: danger: ‘decodeAscii85(instr,  insize, & size1)’ leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#  493|   
#  494|           /* Accumulate results in outa */
#  495|->     maxsize = (l_int32)(80. + (insize * 4. / 5.));  /* plenty big */
#  496|       if ((outa = (l_uint8 *)LEPT_CALLOC(maxsize, sizeof(l_uint8))) == NULL)
#  497|           return (l_uint8 *)ERROR_PTR("outa not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING: [#def696]
leptonica-1.87.0/src/encoding.c:496:28: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.87.0/src/encoding.c:486:8: branch_false: following ‘false’ branch (when ‘poutsize’ is non-NULL)...
leptonica-1.87.0/src/encoding.c:488:5: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:489:8: branch_false: following ‘false’ branch (when ‘inarray’ is non-NULL)...
leptonica-1.87.0/src/encoding.c:491:8: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:491:8: branch_false: following ‘false’ branch (when ‘insize != 0’)...
leptonica-1.87.0/src/encoding.c:495:32: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:496:28: danger: operand ‘4.0e+0’ is of type ‘double’
#  494|           /* Accumulate results in outa */
#  495|       maxsize = (l_int32)(80. + (insize * 4. / 5.));  /* plenty big */
#  496|->     if ((outa = (l_uint8 *)LEPT_CALLOC(maxsize, sizeof(l_uint8))) == NULL)
#  497|           return (l_uint8 *)ERROR_PTR("outa not made", __func__, NULL);
#  498|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def697]
leptonica-1.87.0/src/encoding.c:530:13: warning[-Wanalyzer-malloc-leak]: leak of ‘outa’
leptonica-1.87.0/src/encoding.c:486:8: branch_false: following ‘false’ branch (when ‘poutsize’ is non-NULL)...
leptonica-1.87.0/src/encoding.c:488:5: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:489:8: branch_false: following ‘false’ branch (when ‘inarray’ is non-NULL)...
leptonica-1.87.0/src/encoding.c:491:8: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:491:8: branch_false: following ‘false’ branch (when ‘insize != 0’)...
leptonica-1.87.0/src/encoding.c:495:32: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:496:28: acquire_memory: allocated here
leptonica-1.87.0/src/encoding.c:496:8: branch_false: following ‘false’ branch (when ‘outa’ is non-NULL)...
leptonica-1.87.0/src/encoding.c:496:8: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:502:36: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/encoding.c:503:9: branch_true: ...to here
leptonica-1.87.0/src/encoding.c:510:12: branch_false: following ‘false’ branch (when ‘val > 84’)...
leptonica-1.87.0/src/encoding.c:523:20: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:523:19: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/encoding.c:529:19: branch_false: ...to here
leptonica-1.87.0/src/encoding.c:529:19: branch_true: following ‘true’ branch (when ‘inc == 126’)...
leptonica-1.87.0/src/encoding.c:530:13: branch_true: ...to here
leptonica-1.87.0/src/encoding.c:530:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/encoding.c:530:13: branch_true: ...to here
leptonica-1.87.0/src/encoding.c:530:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/encoding.c:530:13: danger: ‘outa’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  528|               ocount += 4;
#  529|           } else if (inc == '~') {  /* end of data */
#  530|->             L_INFO(" %d extra bytes output\n", __func__, bytecount - 1);
#  531|               switch (bytecount) {
#  532|               case 0:   /* normal eof */

Error: COMPILER_WARNING (CWE-457): [#def698]
leptonica-1.87.0/src/enhance.c: scope_hint: In function ‘pixUnsharpMaskingGray1D’
leptonica-1.87.0/src/enhance.c:1321:32: warning[-Wmaybe-uninitialized]: ‘a[3]’ may be used uninitialized
# 1321 |                           a[4] * GET_DATA_BYTE(lines, j + 2);
leptonica-1.87.0/src/enhance.c:1265:17: note: ‘a[3]’ was declared here
# 1265 | l_float32  val, a[5];
#      |                 ^
# 1319|                             a[2] * GET_DATA_BYTE(lines, j) +
# 1320|                             a[3] * GET_DATA_BYTE(lines, j + 1) +
# 1321|->                           a[4] * GET_DATA_BYTE(lines, j + 2);
# 1322|                       ival = (l_int32)val;
# 1323|                       ival = L_MAX(0, ival);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def699]
leptonica-1.87.0/src/enhance.c:1931:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rlut’
leptonica-1.87.0/src/enhance.c:1914:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: ...to here
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1918:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1925:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/enhance.c:1928:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/enhance.c:1929:9: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1930:12: branch_true: following ‘true’ branch (when ‘rfract >= 0.0’)...
leptonica-1.87.0/src/enhance.c:1931:32: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1931:13: danger: ‘rlut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
# 1929|           fi = i;
# 1930|           if (rfract >= 0) {
# 1931|->             rlut[i] = (l_int32)(fi + (255.0 - fi) * rfract);
# 1932|           } else {
# 1933|               rlut[i] = (l_int32)(fi * (1.0 + rfract));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def700]
leptonica-1.87.0/src/enhance.c:1933:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rlut’
leptonica-1.87.0/src/enhance.c:1914:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: ...to here
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1918:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1925:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/enhance.c:1928:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/enhance.c:1929:9: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1930:12: branch_false: following ‘false’ branch (when ‘rfract < 0.0’)...
leptonica-1.87.0/src/enhance.c:1933:32: branch_false: ...to here
leptonica-1.87.0/src/enhance.c:1933:13: danger: ‘rlut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
# 1931|               rlut[i] = (l_int32)(fi + (255.0 - fi) * rfract);
# 1932|           } else {
# 1933|->             rlut[i] = (l_int32)(fi * (1.0 + rfract));
# 1934|           }
# 1935|           if (gfract >= 0) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def701]
leptonica-1.87.0/src/enhance.c:1936:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘glut’
leptonica-1.87.0/src/enhance.c:1914:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: ...to here
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1918:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1926:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/enhance.c:1928:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/enhance.c:1929:9: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1930:12: branch_true: following ‘true’ branch (when ‘rfract >= 0.0’)...
leptonica-1.87.0/src/enhance.c:1931:32: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1935:12: branch_true: following ‘true’ branch (when ‘gfract >= 0.0’)...
leptonica-1.87.0/src/enhance.c:1936:32: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1936:13: danger: ‘glut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
# 1934|           }
# 1935|           if (gfract >= 0) {
# 1936|->             glut[i] = (l_int32)(fi + (255.0 - fi) * gfract);
# 1937|           } else {
# 1938|               glut[i] = (l_int32)(fi * (1.0 + gfract));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def702]
leptonica-1.87.0/src/enhance.c:1938:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘glut’
leptonica-1.87.0/src/enhance.c:1914:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: ...to here
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1918:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1926:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/enhance.c:1928:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/enhance.c:1929:9: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1930:12: branch_true: following ‘true’ branch (when ‘rfract >= 0.0’)...
leptonica-1.87.0/src/enhance.c:1931:32: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1935:12: branch_false: following ‘false’ branch (when ‘gfract < 0.0’)...
leptonica-1.87.0/src/enhance.c:1938:32: branch_false: ...to here
leptonica-1.87.0/src/enhance.c:1938:13: danger: ‘glut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
# 1936|               glut[i] = (l_int32)(fi + (255.0 - fi) * gfract);
# 1937|           } else {
# 1938|->             glut[i] = (l_int32)(fi * (1.0 + gfract));
# 1939|           }
# 1940|           if (bfract >= 0) {

Error: CPPCHECK_WARNING (CWE-476): [#def703]
leptonica-1.87.0/src/enhance.c:1941: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: blut
# 1939|           }
# 1940|           if (bfract >= 0) {
# 1941|->             blut[i] = (l_int32)(fi + (255.0 - fi) * bfract);
# 1942|           } else {
# 1943|               blut[i] = (l_int32)(fi * (1.0 + bfract));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def704]
leptonica-1.87.0/src/enhance.c:1941:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘blut’
leptonica-1.87.0/src/enhance.c:1914:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: ...to here
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1918:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1927:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/enhance.c:1928:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/enhance.c:1929:9: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1930:12: branch_true: following ‘true’ branch (when ‘rfract >= 0.0’)...
leptonica-1.87.0/src/enhance.c:1931:32: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1935:12: branch_true: following ‘true’ branch (when ‘gfract >= 0.0’)...
leptonica-1.87.0/src/enhance.c:1936:32: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1940:12: branch_true: following ‘true’ branch (when ‘bfract >= 0.0’)...
leptonica-1.87.0/src/enhance.c:1941:32: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1941:13: danger: ‘blut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 1939|           }
# 1940|           if (bfract >= 0) {
# 1941|->             blut[i] = (l_int32)(fi + (255.0 - fi) * bfract);
# 1942|           } else {
# 1943|               blut[i] = (l_int32)(fi * (1.0 + bfract));

Error: CPPCHECK_WARNING (CWE-476): [#def705]
leptonica-1.87.0/src/enhance.c:1943: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: blut
# 1941|               blut[i] = (l_int32)(fi + (255.0 - fi) * bfract);
# 1942|           } else {
# 1943|->             blut[i] = (l_int32)(fi * (1.0 + bfract));
# 1944|           }
# 1945|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def706]
leptonica-1.87.0/src/enhance.c:1943:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘blut’
leptonica-1.87.0/src/enhance.c:1914:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: ...to here
leptonica-1.87.0/src/enhance.c:1916:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1918:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/enhance.c:1927:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/enhance.c:1928:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/enhance.c:1929:9: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1930:12: branch_true: following ‘true’ branch (when ‘rfract >= 0.0’)...
leptonica-1.87.0/src/enhance.c:1931:32: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1935:12: branch_true: following ‘true’ branch (when ‘gfract >= 0.0’)...
leptonica-1.87.0/src/enhance.c:1936:32: branch_true: ...to here
leptonica-1.87.0/src/enhance.c:1940:12: branch_false: following ‘false’ branch (when ‘bfract < 0.0’)...
leptonica-1.87.0/src/enhance.c:1943:32: branch_false: ...to here
leptonica-1.87.0/src/enhance.c:1943:13: danger: ‘blut + (long unsigned int)i * 4’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
# 1941|               blut[i] = (l_int32)(fi + (255.0 - fi) * bfract);
# 1942|           } else {
# 1943|->             blut[i] = (l_int32)(fi * (1.0 + bfract));
# 1944|           }
# 1945|       }

Error: COMPILER_WARNING (CWE-457): [#def707]
leptonica-1.87.0/src/environ.h:611:14: warning[-Wmaybe-uninitialized]: ‘nbot’ may be used uninitialized
#  611 |              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#      |              ^
leptonica-1.87.0/src/dewarp2.c:159:27: note: ‘nbot’ was declared here
#  159 | l_int32  linecount, ntop, nbot, ytop, ybot, ret;
#      |                           ^~~~
#  609|     #define L_WARNING(a, ...) \
#  610|         IF_SEV(L_SEVERITY_WARNING, \
#  611|->              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#  612|                (void)0)
#  613|     #define L_INFO(a, ...) \

Error: COMPILER_WARNING (CWE-457): [#def708]
leptonica-1.87.0/src/alltypes.h:37: included_from: Included from here.
leptonica-1.87.0/src/allheaders.h:35: included_from: Included from here.
leptonica-1.87.0/src/dewarp2.c:67: included_from: Included from here.
leptonica-1.87.0/src/environ.h:611:14: warning[-Wmaybe-uninitialized]: ‘ntop’ may be used uninitialized
#  611 |              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#      |              ^
leptonica-1.87.0/src/dewarp2.c:159:21: note: ‘ntop’ was declared here
#  159 | l_int32  linecount, ntop, nbot, ytop, ybot, ret;
#      |                     ^~~~
#  609|     #define L_WARNING(a, ...) \
#  610|         IF_SEV(L_SEVERITY_WARNING, \
#  611|->              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#  612|                (void)0)
#  613|     #define L_INFO(a, ...) \

Error: COMPILER_WARNING (CWE-457): [#def709]
leptonica-1.87.0/src/environ.h:611:14: warning[-Wmaybe-uninitialized]: ‘ybot’ may be used uninitialized
#  611 |              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#      |              ^
leptonica-1.87.0/src/dewarp2.c:159:39: note: ‘ybot’ was declared here
#  159 | l_int32  linecount, ntop, nbot, ytop, ybot, ret;
#      |                                       ^~~~
#  609|     #define L_WARNING(a, ...) \
#  610|         IF_SEV(L_SEVERITY_WARNING, \
#  611|->              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#  612|                (void)0)
#  613|     #define L_INFO(a, ...) \

Error: COMPILER_WARNING (CWE-457): [#def710]
leptonica-1.87.0/src/environ.h:611:14: warning[-Wmaybe-uninitialized]: ‘ytop’ may be used uninitialized
#  611 |              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#      |              ^
leptonica-1.87.0/src/dewarp2.c:159:33: note: ‘ytop’ was declared here
#  159 | l_int32  linecount, ntop, nbot, ytop, ybot, ret;
#      |                                 ^~~~
#  609|     #define L_WARNING(a, ...) \
#  610|         IF_SEV(L_SEVERITY_WARNING, \
#  611|->              (void)lept_stderr("Warning in %s: " a, __VA_ARGS__), \
#  612|                (void)0)
#  613|     #define L_INFO(a, ...) \

Error: COMPILER_WARNING: [#def711]
leptonica-1.87.0/src/fhmtgenlow.1.c:272:28: warning[-Wunused-but-set-variable=]: variable ‘wpls3’ set but not used
#  272 | l_int32             wpls2, wpls3, wpls4;
#      |                            ^~~~~
#  270|   l_int32    j, pwpls;
#  271|   l_uint32  *sptr, *dptr;
#  272|-> l_int32             wpls2, wpls3, wpls4;
#  273|   l_int32             wpls5, wpls6;
#  274|   

Error: COMPILER_WARNING: [#def712]
leptonica-1.87.0/src/fhmtgenlow.1.c:272:35: warning[-Wunused-but-set-variable=]: variable ‘wpls4’ set but not used
#  272 | l_int32             wpls2, wpls3, wpls4;
#      |                                   ^~~~~
#  270|   l_int32    j, pwpls;
#  271|   l_uint32  *sptr, *dptr;
#  272|-> l_int32             wpls2, wpls3, wpls4;
#  273|   l_int32             wpls5, wpls6;
#  274|   

Error: COMPILER_WARNING: [#def713]
leptonica-1.87.0/src/fhmtgenlow.1.c: scope_hint: In function ‘fhmt_1_5’
leptonica-1.87.0/src/fhmtgenlow.1.c:273:21: warning[-Wunused-but-set-variable=]: variable ‘wpls5’ set but not used
#  273 | l_int32             wpls5, wpls6;
#      |                     ^~~~~
#  271|   l_uint32  *sptr, *dptr;
#  272|   l_int32             wpls2, wpls3, wpls4;
#  273|-> l_int32             wpls5, wpls6;
#  274|   
#  275|       wpls2 = 2 * wpls;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def714]
leptonica-1.87.0/src/fpix1.c:160:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: following ‘true’ branch (when ‘copyflag == 1’)...
leptonica-1.87.0/src/fpix1.c:610:21: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:610:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
#  158|   
#  159|       if (width <= 0)
#  160|->         return (FPIX *)ERROR_PTR("width must be > 0", __func__, NULL);
#  161|       if (height <= 0)
#  162|           return (FPIX *)ERROR_PTR("height must be > 0", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def715]
leptonica-1.87.0/src/fpix1.c:162:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: following ‘true’ branch (when ‘copyflag == 1’)...
leptonica-1.87.0/src/fpix1.c:610:21: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:610:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
#  160|           return (FPIX *)ERROR_PTR("width must be > 0", __func__, NULL);
#  161|       if (height <= 0)
#  162|->         return (FPIX *)ERROR_PTR("height must be > 0", __func__, NULL);
#  163|   
#  164|           /* Avoid overflow in malloc arg, malicious or otherwise */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def716]
leptonica-1.87.0/src/fpix1.c:167:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: following ‘true’ branch (when ‘copyflag == 1’)...
leptonica-1.87.0/src/fpix1.c:610:21: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:610:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
#  165|       npix64 = (l_uint64)width * (l_uint64)height;   /* # of 4-byte pixels */
#  166|       if (npix64 >= (1LL << 29)) {
#  167|->         L_ERROR("requested w = %d, h = %d\n", __func__, width, height);
#  168|           return (FPIX *)ERROR_PTR("requested bytes >= 2^31", __func__, NULL);
#  169|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def717]
leptonica-1.87.0/src/fpix1.c:168:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: following ‘true’ branch (when ‘copyflag == 1’)...
leptonica-1.87.0/src/fpix1.c:610:21: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:610:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
#  166|       if (npix64 >= (1LL << 29)) {
#  167|           L_ERROR("requested w = %d, h = %d\n", __func__, width, height);
#  168|->         return (FPIX *)ERROR_PTR("requested bytes >= 2^31", __func__, NULL);
#  169|       }
#  170|   

Error: CPPCHECK_WARNING (CWE-476): [#def718]
leptonica-1.87.0/src/fpix1.c:174: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fpixd
#  172|       fpixSetDimensions(fpixd, width, height);
#  173|       fpixSetWpl(fpixd, width);  /* 4-byte words */
#  174|->     fpixd->refcount = 1;
#  175|   
#  176|       data = (l_float32 *)LEPT_CALLOC((size_t)width * height, sizeof(l_float32));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def719]
leptonica-1.87.0/src/fpix1.c:179:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: following ‘true’ branch (when ‘copyflag == 1’)...
leptonica-1.87.0/src/fpix1.c:610:21: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:610:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
#  177|       if (!data) {
#  178|           fpixDestroy(&fpixd);
#  179|->         return (FPIX *)ERROR_PTR("calloc fail for data", __func__, NULL);
#  180|       }
#  181|       fpixSetData(fpixd, data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def720]
leptonica-1.87.0/src/fpix1.c:182:12: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/fpix1.c:1387:1: enter_function: entry to ‘fpixReadStream’
leptonica-1.87.0/src/fpix1.c:1397:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:1399:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:1399:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:1401:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:1401:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:1409:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:1411:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:1411:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:1414:17: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:1414:17: call_function: calling ‘fpixCreate’ from ‘fpixReadStream’
#  180|       }
#  181|       fpixSetData(fpixd, data);
#  182|->     return fpixd;
#  183|   }
#  184|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def721]
leptonica-1.87.0/src/fpix1.c:231:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_false: following ‘false’ branch (when ‘copyflag != 1’)...
leptonica-1.87.0/src/fpix1.c:612:21: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:612:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
#  229|   {
#  230|       if (!fpix)
#  231|->         return (FPIX *)ERROR_PTR("fpix not defined", __func__, NULL);
#  232|       ++fpix->refcount;
#  233|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def722]
leptonica-1.87.0/src/fpix1.c:252:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: following ‘true’ branch (when ‘copyflag == 1’)...
leptonica-1.87.0/src/fpix1.c:610:21: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:610:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
#  250|   
#  251|       if (!fpixs)
#  252|->         return (FPIX *)ERROR_PTR("fpixs not defined", __func__, NULL);
#  253|   
#  254|           /* Total bytes in image data */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def723]
leptonica-1.87.0/src/fpix1.c:343:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: following ‘true’ branch (when ‘copyflag == 1’)...
leptonica-1.87.0/src/fpix1.c:610:21: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:610:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
#  341|   {
#  342|       if (!fpix)
#  343|->         return ERROR_INT("fpix not defined", __func__, 1);
#  344|       fpix->w = w;
#  345|       fpix->h = h;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def724]
leptonica-1.87.0/src/fpix1.c:377:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: following ‘true’ branch (when ‘copyflag == 1’)...
leptonica-1.87.0/src/fpix1.c:610:21: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:610:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
#  375|   {
#  376|       if (!fpix)
#  377|->         return ERROR_INT("fpix not defined", __func__, 1);
#  378|   
#  379|       fpix->wpl = wpl;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def725]
leptonica-1.87.0/src/fpix1.c:472:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/fpix1.c:1387:1: enter_function: entry to ‘fpixReadStream’
leptonica-1.87.0/src/fpix1.c:1397:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:1399:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:1399:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:1401:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:1401:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:1409:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:1411:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:1411:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:1414:17: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:1414:17: call_function: calling ‘fpixCreate’ from ‘fpixReadStream’
#  470|   {
#  471|       if (!fpix)
#  472|->         return ERROR_INT("fpix not defined", __func__, 1);
#  473|   
#  474|       fpix->data = data;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def726]
leptonica-1.87.0/src/fpix1.c:560:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fpixaCreate(*fpixa.n)’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: following ‘true’ branch (when ‘copyflag == 1’)...
leptonica-1.87.0/src/fpix1.c:610:21: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:610:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
#  558|   FPIXA  *fpixa;
#  559|   
#  560|->     if (n <= 0 || n > MaxPtrArraySize)
#  561|           n = InitialPtrArraySize;
#  562|   

Error: CPPCHECK_WARNING (CWE-476): [#def727]
leptonica-1.87.0/src/fpix1.c:564: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fpixa
#  562|   
#  563|       fpixa = (FPIXA *)LEPT_CALLOC(1, sizeof(FPIXA));
#  564|->     fpixa->n = 0;
#  565|       fpixa->nalloc = n;
#  566|       fpixa->refcount = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def728]
leptonica-1.87.0/src/fpix1.c:565: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fpixa
#  563|       fpixa = (FPIXA *)LEPT_CALLOC(1, sizeof(FPIXA));
#  564|       fpixa->n = 0;
#  565|->     fpixa->nalloc = n;
#  566|       fpixa->refcount = 1;
#  567|       fpixa->fpix = (FPIX **)LEPT_CALLOC(n, sizeof(FPIX *));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def729]
leptonica-1.87.0/src/fpix1.c:565:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fpixa’
leptonica-1.87.0/src/fpix1.c:563:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/fpix1.c:565:5: danger: ‘fpixa’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/0)
#  563|       fpixa = (FPIXA *)LEPT_CALLOC(1, sizeof(FPIXA));
#  564|       fpixa->n = 0;
#  565|->     fpixa->nalloc = n;
#  566|       fpixa->refcount = 1;
#  567|       fpixa->fpix = (FPIX **)LEPT_CALLOC(n, sizeof(FPIX *));

Error: CPPCHECK_WARNING (CWE-476): [#def730]
leptonica-1.87.0/src/fpix1.c:566: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fpixa
#  564|       fpixa->n = 0;
#  565|       fpixa->nalloc = n;
#  566|->     fpixa->refcount = 1;
#  567|       fpixa->fpix = (FPIX **)LEPT_CALLOC(n, sizeof(FPIX *));
#  568|       return fpixa;

Error: CPPCHECK_WARNING (CWE-476): [#def731]
leptonica-1.87.0/src/fpix1.c:567: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fpixa
#  565|       fpixa->nalloc = n;
#  566|       fpixa->refcount = 1;
#  567|->     fpixa->fpix = (FPIX **)LEPT_CALLOC(n, sizeof(FPIX *));
#  568|       return fpixa;
#  569|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def732]
leptonica-1.87.0/src/fpix1.c:679:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_false: following ‘false’ branch (when ‘copyflag != 1’)...
leptonica-1.87.0/src/fpix1.c:612:21: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:612:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:612:21: return_function: returning to ‘fpixaCopy’ from ‘fpixaGetFPix’
leptonica-1.87.0/src/fpix1.c:613:9: call_function: calling ‘fpixaAddFPix’ from ‘fpixaCopy’
#  677|           return ERROR_INT("fpixa not defined", __func__, 1);
#  678|       if (!fpix)
#  679|->         return ERROR_INT("fpix not defined", __func__, 1);
#  680|   
#  681|       if (copyflag == L_INSERT)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def733]
leptonica-1.87.0/src/fpix1.c:700:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*fpixa.fpix + (long unsigned int)fpixaGetCount(fpixa) * 8’
leptonica-1.87.0/src/fpix1.c:588:1: enter_function: entry to ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:595:8: branch_false: following ‘false’ branch (when ‘fpixa’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:598:8: branch_false: following ‘false’ branch (when ‘copyflag != 2’)...
leptonica-1.87.0/src/fpix1.c:603:9: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:603:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:19: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:606:19: call_function: calling ‘fpixaCreate’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:606:19: return_function: returning to ‘fpixaCopy’ from ‘fpixaCreate’
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix1.c:606:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:608:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix1.c:609:12: branch_true: ...to here
leptonica-1.87.0/src/fpix1.c:609:12: branch_false: following ‘false’ branch (when ‘copyflag != 1’)...
leptonica-1.87.0/src/fpix1.c:612:21: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:612:21: call_function: calling ‘fpixaGetFPix’ from ‘fpixaCopy’
leptonica-1.87.0/src/fpix1.c:612:21: return_function: returning to ‘fpixaCopy’ from ‘fpixaGetFPix’
leptonica-1.87.0/src/fpix1.c:613:9: call_function: calling ‘fpixaAddFPix’ from ‘fpixaCopy’
#  698|           }
#  699|       }
#  700|->     fpixa->fpix[n] = fpixc;
#  701|       fpixa->n++;
#  702|       return 0;

Error: CPPCHECK_WARNING (CWE-476): [#def734]
leptonica-1.87.0/src/fpix1.c:981: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dpix
#  979|       dpixSetDimensions(dpix, width, height);
#  980|       dpixSetWpl(dpix, width);  /* 8 byte words */
#  981|->     dpix->refcount = 1;
#  982|   
#  983|       data = (l_float64 *)LEPT_CALLOC((size_t)width * height, sizeof(l_float64));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def735]
leptonica-1.87.0/src/fpix1.c:989:12: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/fpix1.c:959:1: enter_function: entry to ‘dpixCreate’
leptonica-1.87.0/src/fpix1.c:966:8: branch_false: following ‘false’ branch (when ‘width > 0’)...
leptonica-1.87.0/src/fpix1.c:968:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:968:8: branch_false: following ‘false’ branch (when ‘height > 0’)...
leptonica-1.87.0/src/fpix1.c:972:14: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:973:8: branch_false: following ‘false’ branch (when ‘npix64 <= 268435455’)...
leptonica-1.87.0/src/fpix1.c:978:20: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:979:5: call_function: calling ‘dpixSetDimensions’ from ‘dpixCreate’
leptonica-1.87.0/src/fpix1.c:979:5: return_function: returning to ‘dpixCreate’ from ‘dpixSetDimensions’
leptonica-1.87.0/src/fpix1.c:980:5: call_function: calling ‘dpixSetWpl’ from ‘dpixCreate’
leptonica-1.87.0/src/fpix1.c:980:5: return_function: returning to ‘dpixCreate’ from ‘dpixSetWpl’
leptonica-1.87.0/src/fpix1.c:983:25: acquire_memory: allocated here
leptonica-1.87.0/src/fpix1.c:984:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:988:5: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:988:5: call_function: calling ‘dpixSetData’ from ‘dpixCreate’
leptonica-1.87.0/src/fpix1.c:988:5: return_function: returning to ‘dpixCreate’ from ‘dpixSetData’
leptonica-1.87.0/src/fpix1.c:989:12: danger: ‘data’ leaks here; was allocated at [(18)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/17)
#  987|       }
#  988|       dpixSetData(dpix, data);
#  989|->     return dpix;
#  990|   }
#  991|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def736]
leptonica-1.87.0/src/fpix1.c:1277:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/fpix1.c:959:1: enter_function: entry to ‘dpixCreate’
leptonica-1.87.0/src/fpix1.c:966:8: branch_false: following ‘false’ branch (when ‘width > 0’)...
leptonica-1.87.0/src/fpix1.c:968:8: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:968:8: branch_false: following ‘false’ branch (when ‘height > 0’)...
leptonica-1.87.0/src/fpix1.c:972:14: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:973:8: branch_false: following ‘false’ branch (when ‘npix64 <= 268435455’)...
leptonica-1.87.0/src/fpix1.c:978:20: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:979:5: call_function: calling ‘dpixSetDimensions’ from ‘dpixCreate’
leptonica-1.87.0/src/fpix1.c:979:5: return_function: returning to ‘dpixCreate’ from ‘dpixSetDimensions’
leptonica-1.87.0/src/fpix1.c:980:5: call_function: calling ‘dpixSetWpl’ from ‘dpixCreate’
leptonica-1.87.0/src/fpix1.c:980:5: return_function: returning to ‘dpixCreate’ from ‘dpixSetWpl’
leptonica-1.87.0/src/fpix1.c:983:25: acquire_memory: allocated here
leptonica-1.87.0/src/fpix1.c:984:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/fpix1.c:988:5: branch_false: ...to here
leptonica-1.87.0/src/fpix1.c:988:5: call_function: calling ‘dpixSetData’ from ‘dpixCreate’
# 1275|   {
# 1276|       if (!dpix)
# 1277|->         return ERROR_INT("dpix not defined", __func__, 1);
# 1278|   
# 1279|       dpix->data = data;

Error: CPPCHECK_WARNING (CWE-476): [#def737]
leptonica-1.87.0/src/fpix2.c:920: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fract
#  918|       fract = (l_float32 *)LEPT_CALLOC(factor, sizeof(l_float32));
#  919|       for (i = 0; i < factor; i++)
#  920|->         fract[i] = i / (l_float32)factor;
#  921|       for (i = 0; i < hs - 1; i++) {
#  922|           lines = datas + i * wpls;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def738]
leptonica-1.87.0/src/fpix2.c:920:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fract’
leptonica-1.87.0/src/fpix2.c:907:8: branch_false: following ‘false’ branch (when ‘fpixs’ is non-NULL)...
leptonica-1.87.0/src/fpix2.c:910:5: branch_false: ...to here
leptonica-1.87.0/src/fpix2.c:918:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/fpix2.c:919:17: branch_true: following ‘true’ branch (when ‘i < factor’)...
leptonica-1.87.0/src/fpix2.c:920:20: branch_true: ...to here
leptonica-1.87.0/src/fpix2.c:920:9: danger: ‘fract + (long unsigned int)i * 4’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  918|       fract = (l_float32 *)LEPT_CALLOC(factor, sizeof(l_float32));
#  919|       for (i = 0; i < factor; i++)
#  920|->         fract[i] = i / (l_float32)factor;
#  921|       for (i = 0; i < hs - 1; i++) {
#  922|           lines = datas + i * wpls;

Error: CPPCHECK_WARNING (CWE-476): [#def739]
leptonica-1.87.0/src/fpix2.c:1010: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fract
# 1008|       fract = (l_float64 *)LEPT_CALLOC(factor, sizeof(l_float64));
# 1009|       for (i = 0; i < factor; i++)
# 1010|->         fract[i] = i / (l_float64)factor;
# 1011|       for (i = 0; i < hs - 1; i++) {
# 1012|           lines = datas + i * wpls;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def740]
leptonica-1.87.0/src/fpix2.c:1010:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fract’
leptonica-1.87.0/src/fpix2.c:997:8: branch_false: following ‘false’ branch (when ‘dpixs’ is non-NULL)...
leptonica-1.87.0/src/fpix2.c:1000:5: branch_false: ...to here
leptonica-1.87.0/src/fpix2.c:1008:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/fpix2.c:1009:17: branch_true: following ‘true’ branch (when ‘i < factor’)...
leptonica-1.87.0/src/fpix2.c:1010:20: branch_true: ...to here
leptonica-1.87.0/src/fpix2.c:1010:9: danger: ‘fract + (long unsigned int)i * 8’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1008|       fract = (l_float64 *)LEPT_CALLOC(factor, sizeof(l_float64));
# 1009|       for (i = 0; i < factor; i++)
# 1010|->         fract[i] = i / (l_float64)factor;
# 1011|       for (i = 0; i < hs - 1; i++) {
# 1012|           lines = datas + i * wpls;

Error: CPPCHECK_WARNING (CWE-476): [#def741]
leptonica-1.87.0/src/fpix2.c:1864: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
# 1862|       for (i = 0; i < h; i++) {
# 1863|           line = data + i * wpl;
# 1864|->         memcpy(buffer, line, bpl);
# 1865|           for (j = 0; j < w; j++)
# 1866|               line[j] = buffer[w - 1 - j];

Error: GCC_ANALYZER_WARNING (CWE-688): [#def742]
leptonica-1.87.0/src/fpix2.c:1864:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buffer’ where non-null expected
leptonica-1.87.0/src/fpix2.c:1850:8: branch_false: following ‘false’ branch (when ‘fpixs’ is non-NULL)...
leptonica-1.87.0/src/fpix2.c:1854:8: branch_false: ...to here
leptonica-1.87.0/src/fpix2.c:1861:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/fpix2.c:1862:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/fpix2.c:1863:23: branch_true: ...to here
leptonica-1.87.0/src/fpix2.c:1864:9: danger: argument 1 (‘buffer’) from [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
# 1862|       for (i = 0; i < h; i++) {
# 1863|           line = data + i * wpl;
# 1864|->         memcpy(buffer, line, bpl);
# 1865|           for (j = 0; j < w; j++)
# 1866|               line[j] = buffer[w - 1 - j];

Error: CPPCHECK_WARNING (CWE-476): [#def743]
leptonica-1.87.0/src/fpix2.c:1866: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
# 1864|           memcpy(buffer, line, bpl);
# 1865|           for (j = 0; j < w; j++)
# 1866|->             line[j] = buffer[w - 1 - j];
# 1867|       }
# 1868|       LEPT_FREE(buffer);

Error: CPPCHECK_WARNING (CWE-476): [#def744]
leptonica-1.87.0/src/fpix2.c:1916: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
# 1914|           linet = data + i * wpl;
# 1915|           lineb = data + k * wpl;
# 1916|->         memcpy(buffer, linet, bpl);
# 1917|           memcpy(linet, lineb, bpl);
# 1918|           memcpy(lineb, buffer, bpl);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def745]
leptonica-1.87.0/src/fpix2.c:1916:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buffer’ where non-null expected
leptonica-1.87.0/src/fpix2.c:1900:8: branch_false: following ‘false’ branch (when ‘fpixs’ is non-NULL)...
leptonica-1.87.0/src/fpix2.c:1904:8: branch_false: ...to here
leptonica-1.87.0/src/fpix2.c:1910:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/fpix2.c:1913:28: branch_true: following ‘true’ branch (when ‘i < h2’)...
leptonica-1.87.0/src/fpix2.c:1914:24: branch_true: ...to here
leptonica-1.87.0/src/fpix2.c:1916:9: danger: argument 1 (‘buffer’) from [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
# 1914|           linet = data + i * wpl;
# 1915|           lineb = data + k * wpl;
# 1916|->         memcpy(buffer, linet, bpl);
# 1917|           memcpy(linet, lineb, bpl);
# 1918|           memcpy(lineb, buffer, bpl);

Error: CPPCHECK_WARNING (CWE-476): [#def746]
leptonica-1.87.0/src/fpix2.c:1918: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
# 1916|           memcpy(buffer, linet, bpl);
# 1917|           memcpy(linet, lineb, bpl);
# 1918|->         memcpy(lineb, buffer, bpl);
# 1919|       }
# 1920|       LEPT_FREE(buffer);

Error: CPPCHECK_WARNING (CWE-476): [#def747]
leptonica-1.87.0/src/fpix2.c:2325: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recip
# 2323|       if (onedenom) {
# 2324|           recip = (l_float32 *)LEPT_CALLOC(256, sizeof(l_float32));
# 2325|->         recip[0] = 256;  /* arbitrary large number */
# 2326|           for (i = 1; i < 256; i++)
# 2327|               recip[i] = 1.0 / (l_float32)i;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def748]
leptonica-1.87.0/src/fpix2.c:2325:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘recip’
leptonica-1.87.0/src/fpix2.c:2309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/fpix2.c:2324:30: acquire_memory: this call could return NULL
leptonica-1.87.0/src/fpix2.c:2325:9: danger: ‘recip’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 2323|       if (onedenom) {
# 2324|           recip = (l_float32 *)LEPT_CALLOC(256, sizeof(l_float32));
# 2325|->         recip[0] = 256;  /* arbitrary large number */
# 2326|           for (i = 1; i < 256; i++)
# 2327|               recip[i] = 1.0 / (l_float32)i;

Error: CPPCHECK_WARNING (CWE-476): [#def749]
leptonica-1.87.0/src/fpix2.c:2327: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recip
# 2325|           recip[0] = 256;  /* arbitrary large number */
# 2326|           for (i = 1; i < 256; i++)
# 2327|->             recip[i] = 1.0 / (l_float32)i;
# 2328|       }
# 2329|       for (i = 0; i < h; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def750]
leptonica-1.87.0/src/gifio.c:619:13: warning[-Wanalyzer-malloc-leak]: leak of ‘gif_line’
leptonica-1.87.0/src/gifio.c:371:1: enter_function: entry to ‘pixWriteStreamGif’
leptonica-1.87.0/src/gifio.c:377:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/gifio.c:379:8: branch_false: ...to here
leptonica-1.87.0/src/gifio.c:379:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/gifio.c:382:5: branch_false: ...to here
leptonica-1.87.0/src/gifio.c:383:9: call_function: calling ‘pixWriteMemGif’ from ‘pixWriteStreamGif’
#  617|   
#  618|               /* Compress and save the line */
#  619|->         if (EGifPutLine(gif, gif_line, w) != GIF_OK) {
#  620|               LEPT_FREE(gif_line);
#  621|               pixDestroy(&pixd);

Error: CPPCHECK_WARNING (CWE-476): [#def751]
leptonica-1.87.0/src/gplot.c:221: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gplot
#  219|   
#  220|       gplot = (GPLOT *)LEPT_CALLOC(1, sizeof(GPLOT));
#  221|->     gplot->cmddata = sarrayCreate(0);
#  222|       gplot->datanames = sarrayCreate(0);
#  223|       gplot->plotdata = sarrayCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def752]
leptonica-1.87.0/src/gplot.c:221:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/gplot.c:221:5: danger: ‘gplot’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  219|   
#  220|       gplot = (GPLOT *)LEPT_CALLOC(1, sizeof(GPLOT));
#  221|->     gplot->cmddata = sarrayCreate(0);
#  222|       gplot->datanames = sarrayCreate(0);
#  223|       gplot->plotdata = sarrayCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def753]
leptonica-1.87.0/src/gplot.c:221:22: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:221:22: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/gplot.c:221:22: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  219|   
#  220|       gplot = (GPLOT *)LEPT_CALLOC(1, sizeof(GPLOT));
#  221|->     gplot->cmddata = sarrayCreate(0);
#  222|       gplot->datanames = sarrayCreate(0);
#  223|       gplot->plotdata = sarrayCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def754]
leptonica-1.87.0/src/gplot.c:222: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gplot
#  220|       gplot = (GPLOT *)LEPT_CALLOC(1, sizeof(GPLOT));
#  221|       gplot->cmddata = sarrayCreate(0);
#  222|->     gplot->datanames = sarrayCreate(0);
#  223|       gplot->plotdata = sarrayCreate(0);
#  224|       gplot->plotlabels = sarrayCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def755]
leptonica-1.87.0/src/gplot.c:222:24: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:222:24: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/gplot.c:222:24: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  220|       gplot = (GPLOT *)LEPT_CALLOC(1, sizeof(GPLOT));
#  221|       gplot->cmddata = sarrayCreate(0);
#  222|->     gplot->datanames = sarrayCreate(0);
#  223|       gplot->plotdata = sarrayCreate(0);
#  224|       gplot->plotlabels = sarrayCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def756]
leptonica-1.87.0/src/gplot.c:223: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gplot
#  221|       gplot->cmddata = sarrayCreate(0);
#  222|       gplot->datanames = sarrayCreate(0);
#  223|->     gplot->plotdata = sarrayCreate(0);
#  224|       gplot->plotlabels = sarrayCreate(0);
#  225|       gplot->plotstyles = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def757]
leptonica-1.87.0/src/gplot.c:223:23: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:223:23: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/gplot.c:223:23: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  221|       gplot->cmddata = sarrayCreate(0);
#  222|       gplot->datanames = sarrayCreate(0);
#  223|->     gplot->plotdata = sarrayCreate(0);
#  224|       gplot->plotlabels = sarrayCreate(0);
#  225|       gplot->plotstyles = numaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def758]
leptonica-1.87.0/src/gplot.c:224: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gplot
#  222|       gplot->datanames = sarrayCreate(0);
#  223|       gplot->plotdata = sarrayCreate(0);
#  224|->     gplot->plotlabels = sarrayCreate(0);
#  225|       gplot->plotstyles = numaCreate(0);
#  226|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def759]
leptonica-1.87.0/src/gplot.c:224:25: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:224:25: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/gplot.c:224:25: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  222|       gplot->datanames = sarrayCreate(0);
#  223|       gplot->plotdata = sarrayCreate(0);
#  224|->     gplot->plotlabels = sarrayCreate(0);
#  225|       gplot->plotstyles = numaCreate(0);
#  226|   

Error: CPPCHECK_WARNING (CWE-476): [#def760]
leptonica-1.87.0/src/gplot.c:225: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gplot
#  223|       gplot->plotdata = sarrayCreate(0);
#  224|       gplot->plotlabels = sarrayCreate(0);
#  225|->     gplot->plotstyles = numaCreate(0);
#  226|   
#  227|           /* Save title, labels, rootname, outformat, cmdname, outname */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def761]
leptonica-1.87.0/src/gplot.c:225:25: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:225:25: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/gplot.c:225:25: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  223|       gplot->plotdata = sarrayCreate(0);
#  224|       gplot->plotlabels = sarrayCreate(0);
#  225|->     gplot->plotstyles = numaCreate(0);
#  226|   
#  227|           /* Save title, labels, rootname, outformat, cmdname, outname */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def762]
leptonica-1.87.0/src/gplot.c:228:15: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:228:15: throw: if ‘genPathname’ throws an exception...
leptonica-1.87.0/src/gplot.c:228:15: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  226|   
#  227|           /* Save title, labels, rootname, outformat, cmdname, outname */
#  228|->     newroot = genPathname(rootname, NULL);
#  229|       gplot->rootname = newroot;
#  230|       gplot->outformat = outformat;

Error: CPPCHECK_WARNING (CWE-476): [#def763]
leptonica-1.87.0/src/gplot.c:229: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gplot
#  227|           /* Save title, labels, rootname, outformat, cmdname, outname */
#  228|       newroot = genPathname(rootname, NULL);
#  229|->     gplot->rootname = newroot;
#  230|       gplot->outformat = outformat;
#  231|       snprintf(buf, Bufsize, "%s.cmd", rootname);

Error: CPPCHECK_WARNING (CWE-476): [#def764]
leptonica-1.87.0/src/gplot.c:230: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gplot
#  228|       newroot = genPathname(rootname, NULL);
#  229|       gplot->rootname = newroot;
#  230|->     gplot->outformat = outformat;
#  231|       snprintf(buf, Bufsize, "%s.cmd", rootname);
#  232|       gplot->cmdname = stringNew(buf);

Error: CPPCHECK_WARNING (CWE-476): [#def765]
leptonica-1.87.0/src/gplot.c:232: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gplot
#  230|       gplot->outformat = outformat;
#  231|       snprintf(buf, Bufsize, "%s.cmd", rootname);
#  232|->     gplot->cmdname = stringNew(buf);
#  233|       if (outformat == GPLOT_PNG)
#  234|           snprintf(buf, Bufsize, "%s.png", newroot);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def766]
leptonica-1.87.0/src/gplot.c:232:22: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:232:22: throw: if ‘stringNew’ throws an exception...
leptonica-1.87.0/src/gplot.c:232:22: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  230|       gplot->outformat = outformat;
#  231|       snprintf(buf, Bufsize, "%s.cmd", rootname);
#  232|->     gplot->cmdname = stringNew(buf);
#  233|       if (outformat == GPLOT_PNG)
#  234|           snprintf(buf, Bufsize, "%s.png", newroot);

Error: CPPCHECK_WARNING (CWE-476): [#def767]
leptonica-1.87.0/src/gplot.c:243: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gplot
#  241|       else if (outformat == GPLOT_PNM)
#  242|           snprintf(buf, Bufsize, "%s.pnm", newroot);
#  243|->     gplot->outname = stringNew(buf);
#  244|       if (title) gplot->title = stringNew(title);
#  245|       if (xlabel) gplot->xlabel = stringNew(xlabel);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def768]
leptonica-1.87.0/src/gplot.c:243:22: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:243:22: throw: if ‘stringNew’ throws an exception...
leptonica-1.87.0/src/gplot.c:243:22: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
#  241|       else if (outformat == GPLOT_PNM)
#  242|           snprintf(buf, Bufsize, "%s.pnm", newroot);
#  243|->     gplot->outname = stringNew(buf);
#  244|       if (title) gplot->title = stringNew(title);
#  245|       if (xlabel) gplot->xlabel = stringNew(xlabel);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def769]
leptonica-1.87.0/src/gplot.c:244:31: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:244:8: branch_true: following ‘true’ branch (when ‘title’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:244:31: branch_true: ...to here
leptonica-1.87.0/src/gplot.c:244:31: throw: if ‘stringNew’ throws an exception...
leptonica-1.87.0/src/gplot.c:244:31: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
#  242|           snprintf(buf, Bufsize, "%s.pnm", newroot);
#  243|       gplot->outname = stringNew(buf);
#  244|->     if (title) gplot->title = stringNew(title);
#  245|       if (xlabel) gplot->xlabel = stringNew(xlabel);
#  246|       if (ylabel) gplot->ylabel = stringNew(ylabel);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def770]
leptonica-1.87.0/src/gplot.c:245:33: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:244:8: branch_false: following ‘false’ branch (when ‘title’ is NULL)...
leptonica-1.87.0/src/gplot.c:245:8: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:245:8: branch_true: following ‘true’ branch (when ‘xlabel’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:245:33: branch_true: ...to here
leptonica-1.87.0/src/gplot.c:245:33: throw: if ‘stringNew’ throws an exception...
leptonica-1.87.0/src/gplot.c:245:33: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6)
#  243|       gplot->outname = stringNew(buf);
#  244|       if (title) gplot->title = stringNew(title);
#  245|->     if (xlabel) gplot->xlabel = stringNew(xlabel);
#  246|       if (ylabel) gplot->ylabel = stringNew(ylabel);
#  247|   

Error: CPPCHECK_WARNING (CWE-476): [#def771]
leptonica-1.87.0/src/gplot.c:246: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gplot
#  244|       if (title) gplot->title = stringNew(title);
#  245|       if (xlabel) gplot->xlabel = stringNew(xlabel);
#  246|->     if (ylabel) gplot->ylabel = stringNew(ylabel);
#  247|   
#  248|       return gplot;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def772]
leptonica-1.87.0/src/gplot.c:246:33: warning[-Wanalyzer-malloc-leak]: leak of ‘gplot’
leptonica-1.87.0/src/gplot.c:203:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:205:9: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:205:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:209:5: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:210:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/gplot.c:220:22: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:220:22: acquire_memory: allocated here
leptonica-1.87.0/src/gplot.c:244:8: branch_false: following ‘false’ branch (when ‘title’ is NULL)...
leptonica-1.87.0/src/gplot.c:245:8: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:245:8: branch_false: following ‘false’ branch (when ‘xlabel’ is NULL)...
leptonica-1.87.0/src/gplot.c:246:8: branch_false: ...to here
leptonica-1.87.0/src/gplot.c:246:8: branch_true: following ‘true’ branch (when ‘ylabel’ is non-NULL)...
leptonica-1.87.0/src/gplot.c:246:33: branch_true: ...to here
leptonica-1.87.0/src/gplot.c:246:33: throw: if ‘stringNew’ throws an exception...
leptonica-1.87.0/src/gplot.c:246:33: danger: ‘gplot’ leaks here; was allocated at [(7)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/6)
#  244|       if (title) gplot->title = stringNew(title);
#  245|       if (xlabel) gplot->xlabel = stringNew(xlabel);
#  246|->     if (ylabel) gplot->ylabel = stringNew(ylabel);
#  247|   
#  248|       return gplot;

Error: COMPILER_WARNING: [#def773]
leptonica-1.87.0/src/gplot.c:1209:47: warning[-Wunused-but-set-variable=]: variable ‘ignores’ set but not used
# 1209 | char    *rootname, *title, *xlabel, *ylabel, *ignores;
#      |                                               ^~~~~~~
# 1207|   {
# 1208|   char     buf[Bufsize];
# 1209|-> char    *rootname, *title, *xlabel, *ylabel, *ignores;
# 1210|   l_int32  outformat, ret, version, ignore;
# 1211|   FILE    *fp;

Error: COMPILER_WARNING: [#def774]
leptonica-1.87.0/src/gplot.c: scope_hint: In function ‘gplotRead’
leptonica-1.87.0/src/gplot.c:1210:35: warning[-Wunused-but-set-variable=]: variable ‘ignore’ set but not used
# 1210 | l_int32  outformat, ret, version, ignore;
#      |                                   ^~~~~~
# 1208|   char     buf[Bufsize];
# 1209|   char    *rootname, *title, *xlabel, *ylabel, *ignores;
# 1210|-> l_int32  outformat, ret, version, ignore;
# 1211|   FILE    *fp;
# 1212|   GPLOT   *gplot;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def775]
leptonica-1.87.0/src/graphics.c:1369:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘val32’
leptonica-1.87.0/src/graphics.c:2357:1: enter_function: entry to ‘pixRenderRandomCmapPtaa’
leptonica-1.87.0/src/graphics.c:2368:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/graphics.c:2370:8: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2370:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/graphics.c:2372:9: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2381:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2381:8: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2384:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/graphics.c:2385:21: branch_true: ...to here
leptonica-1.87.0/src/graphics.c:2388:12: branch_false: following ‘false’ branch (when ‘polyflag == 0’)...
leptonica-1.87.0/src/graphics.c:2391:20: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2392:9: call_function: calling ‘pixRenderPtaArb’ from ‘pixRenderRandomCmapPtaa’
# 1367|               pixSetPixel(pix, x, y, index);
# 1368|           else if (d == 32)
# 1369|->             pixSetPixel(pix, x, y, val32);
# 1370|           else
# 1371|               pixSetPixel(pix, x, y, val);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def776]
leptonica-1.87.0/src/graphics.c:1371:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘val’
leptonica-1.87.0/src/graphics.c:2357:1: enter_function: entry to ‘pixRenderRandomCmapPtaa’
leptonica-1.87.0/src/graphics.c:2368:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/graphics.c:2370:8: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2370:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/graphics.c:2372:9: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2381:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2381:8: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2384:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/graphics.c:2385:21: branch_true: ...to here
leptonica-1.87.0/src/graphics.c:2388:12: branch_false: following ‘false’ branch (when ‘polyflag == 0’)...
leptonica-1.87.0/src/graphics.c:2391:20: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2392:9: call_function: calling ‘pixRenderPtaArb’ from ‘pixRenderRandomCmapPtaa’
# 1369|               pixSetPixel(pix, x, y, val32);
# 1370|           else
# 1371|->             pixSetPixel(pix, x, y, val);
# 1372|       }
# 1373|   

Error: COMPILER_WARNING (CWE-457): [#def777]
leptonica-1.87.0/src/graphics.c: scope_hint: In function ‘pixRenderPtaArb’
leptonica-1.87.0/src/graphics.c:1371:13: warning[-Wmaybe-uninitialized]: ‘val’ may be used uninitialized
# 1371 |             pixSetPixel(pix, x, y, val);
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/graphics.c:1327:11: note: ‘val’ was declared here
# 1327 | l_uint8   val;
#      |           ^~~
# 1369|               pixSetPixel(pix, x, y, val32);
# 1370|           else
# 1371|->             pixSetPixel(pix, x, y, val);
# 1372|       }
# 1373|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def778]
leptonica-1.87.0/src/graphics.c:2507:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xend’
leptonica-1.87.0/src/graphics.c:2486:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2488:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/graphics.c:2490:9: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2490:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2493:5: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2494:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2494:25: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2495:23: acquire_memory: allocated here
leptonica-1.87.0/src/graphics.c:2496:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2506:10: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2506:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/graphics.c:2507:9: branch_true: ...to here
leptonica-1.87.0/src/graphics.c:2507:9: throw: if ‘pixFindHorizontalRuns’ throws an exception...
leptonica-1.87.0/src/graphics.c:2507:9: danger: ‘xend’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
# 2505|       found = FALSE;
# 2506|       for (i = ymin + 1; i < h; i++) {
# 2507|->         pixFindHorizontalRuns(pixs, i, xstart, xend, &n);
# 2508|           if (n > 1) {
# 2509|               ptaPtInsidePolygon(pta, xend[0] + 1, i, &inside);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def779]
leptonica-1.87.0/src/graphics.c:2507:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xstart’
leptonica-1.87.0/src/graphics.c:2486:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2488:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/graphics.c:2490:9: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2490:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2493:5: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2494:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2494:25: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2494:25: acquire_memory: allocated here
leptonica-1.87.0/src/graphics.c:2496:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2506:10: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2506:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/graphics.c:2507:9: branch_true: ...to here
leptonica-1.87.0/src/graphics.c:2507:9: throw: if ‘pixFindHorizontalRuns’ throws an exception...
leptonica-1.87.0/src/graphics.c:2507:9: danger: ‘xstart’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 2505|       found = FALSE;
# 2506|       for (i = ymin + 1; i < h; i++) {
# 2507|->         pixFindHorizontalRuns(pixs, i, xstart, xend, &n);
# 2508|           if (n > 1) {
# 2509|               ptaPtInsidePolygon(pta, xend[0] + 1, i, &inside);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def780]
leptonica-1.87.0/src/graphics.c:2517:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xend’
leptonica-1.87.0/src/graphics.c:2486:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2488:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/graphics.c:2490:9: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2490:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2493:5: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2494:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2494:25: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2495:23: acquire_memory: allocated here
leptonica-1.87.0/src/graphics.c:2496:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2506:10: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2506:24: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2516:8: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2516:8: branch_true: following ‘true’ branch (when ‘found == 0’)...
leptonica-1.87.0/src/graphics.c:2517:9: branch_true: ...to here
leptonica-1.87.0/src/graphics.c:2517:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/graphics.c:2517:9: branch_true: ...to here
leptonica-1.87.0/src/graphics.c:2517:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/graphics.c:2517:9: danger: ‘xend’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
# 2515|       }
# 2516|       if (!found) {
# 2517|->         L_WARNING("nothing found to fill\n", __func__);
# 2518|           LEPT_FREE(xstart);
# 2519|           LEPT_FREE(xend);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def781]
leptonica-1.87.0/src/graphics.c:2517:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xstart’
leptonica-1.87.0/src/graphics.c:2486:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2488:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/graphics.c:2490:9: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2490:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2493:5: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2494:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2494:25: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2494:25: acquire_memory: allocated here
leptonica-1.87.0/src/graphics.c:2496:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2506:10: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2506:24: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graphics.c:2516:8: branch_false: ...to here
leptonica-1.87.0/src/graphics.c:2516:8: branch_true: following ‘true’ branch (when ‘found == 0’)...
leptonica-1.87.0/src/graphics.c:2517:9: branch_true: ...to here
leptonica-1.87.0/src/graphics.c:2517:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/graphics.c:2517:9: branch_true: ...to here
leptonica-1.87.0/src/graphics.c:2517:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/graphics.c:2517:9: danger: ‘xstart’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
# 2515|       }
# 2516|       if (!found) {
# 2517|->         L_WARNING("nothing found to fill\n", __func__);
# 2518|           LEPT_FREE(xstart);
# 2519|           LEPT_FREE(xend);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def782]
leptonica-1.87.0/src/graymorph.c:586:9: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/graymorph.c:531:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/graymorph.c:533:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:533:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:535:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:535:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:537:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:571:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:576:5: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:584:24: acquire_memory: allocated here
leptonica-1.87.0/src/graymorph.c:585:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/graymorph.c:586:9: branch_true: ...to here
leptonica-1.87.0/src/graymorph.c:586:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/graymorph.c:586:9: branch_true: ...to here
leptonica-1.87.0/src/graymorph.c:586:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/graymorph.c:586:9: danger: ‘array’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  584|       array = (l_uint8 *)LEPT_CALLOC(2 * maxsize, sizeof(l_uint8));
#  585|       if (!buffer || !array) {
#  586|->         L_ERROR("buffer and array not made\n", __func__);
#  587|           goto cleanup;
#  588|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def783]
leptonica-1.87.0/src/graymorph.c:586:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/graymorph.c:531:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/graymorph.c:533:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:533:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:535:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:535:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:537:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:571:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:576:5: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:582:25: acquire_memory: allocated here
leptonica-1.87.0/src/graymorph.c:585:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/graymorph.c:586:9: branch_true: ...to here
leptonica-1.87.0/src/graymorph.c:586:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/graymorph.c:586:9: branch_true: ...to here
leptonica-1.87.0/src/graymorph.c:586:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/graymorph.c:586:9: danger: ‘buffer’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  584|       array = (l_uint8 *)LEPT_CALLOC(2 * maxsize, sizeof(l_uint8));
#  585|       if (!buffer || !array) {
#  586|->         L_ERROR("buffer and array not made\n", __func__);
#  587|           goto cleanup;
#  588|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def784]
leptonica-1.87.0/src/graymorph.c:607:9: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/graymorph.c:520:1: enter_function: entry to ‘pixCloseGray’
leptonica-1.87.0/src/graymorph.c:531:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/graymorph.c:533:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:533:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:535:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:535:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:537:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:571:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:576:5: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:584:24: acquire_memory: allocated here
leptonica-1.87.0/src/graymorph.c:585:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:590:8: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:590:8: branch_false: following ‘false’ branch (when ‘vsize != 1’)...
leptonica-1.87.0/src/graymorph.c:597:15: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:597:15: branch_false: following ‘false’ branch (when ‘hsize != 1’)...
leptonica-1.87.0/src/graymorph.c:605:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:605:9: call_function: calling ‘dilateGrayLow’ from ‘pixCloseGray’
leptonica-1.87.0/src/graymorph.c:605:9: return_function: returning to ‘pixCloseGray’ from ‘dilateGrayLow’
leptonica-1.87.0/src/graymorph.c:607:9: throw: if ‘pixSetOrClearBorder’ throws an exception...
leptonica-1.87.0/src/graymorph.c:607:9: danger: ‘array’ leaks here; was allocated at [(12)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/11)
#  605|           dilateGrayLow(datat, w, h, wplt, datab, wplb, hsize, L_HORIZ,
#  606|                         buffer, array);
#  607|->         pixSetOrClearBorder(pixt, leftpix, rightpix, toppix, bottompix,
#  608|                               PIX_CLR);
#  609|           dilateGrayLow(datab, w, h, wplb, datat, wplt, vsize, L_VERT,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def785]
leptonica-1.87.0/src/graymorph.c:607:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/graymorph.c:520:1: enter_function: entry to ‘pixCloseGray’
leptonica-1.87.0/src/graymorph.c:531:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/graymorph.c:533:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:533:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:535:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:535:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:537:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:571:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:576:5: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:582:25: acquire_memory: allocated here
leptonica-1.87.0/src/graymorph.c:585:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:590:8: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:590:8: branch_false: following ‘false’ branch (when ‘vsize != 1’)...
leptonica-1.87.0/src/graymorph.c:597:15: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:597:15: branch_false: following ‘false’ branch (when ‘hsize != 1’)...
leptonica-1.87.0/src/graymorph.c:605:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:605:9: call_function: calling ‘dilateGrayLow’ from ‘pixCloseGray’
leptonica-1.87.0/src/graymorph.c:605:9: return_function: returning to ‘pixCloseGray’ from ‘dilateGrayLow’
leptonica-1.87.0/src/graymorph.c:607:9: throw: if ‘pixSetOrClearBorder’ throws an exception...
leptonica-1.87.0/src/graymorph.c:607:9: danger: ‘buffer’ leaks here; was allocated at [(12)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/11)
#  605|           dilateGrayLow(datat, w, h, wplt, datab, wplb, hsize, L_HORIZ,
#  606|                         buffer, array);
#  607|->         pixSetOrClearBorder(pixt, leftpix, rightpix, toppix, bottompix,
#  608|                               PIX_CLR);
#  609|           dilateGrayLow(datab, w, h, wplb, datat, wplt, vsize, L_VERT,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def786]
leptonica-1.87.0/src/graymorph.c:611:9: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/graymorph.c:520:1: enter_function: entry to ‘pixCloseGray’
leptonica-1.87.0/src/graymorph.c:531:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/graymorph.c:533:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:533:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:535:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:535:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:537:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:571:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:576:5: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:584:24: acquire_memory: allocated here
leptonica-1.87.0/src/graymorph.c:585:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:590:8: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:590:8: branch_false: following ‘false’ branch (when ‘vsize != 1’)...
leptonica-1.87.0/src/graymorph.c:597:15: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:597:15: branch_false: following ‘false’ branch (when ‘hsize != 1’)...
leptonica-1.87.0/src/graymorph.c:605:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:605:9: call_function: calling ‘dilateGrayLow’ from ‘pixCloseGray’
leptonica-1.87.0/src/graymorph.c:605:9: return_function: returning to ‘pixCloseGray’ from ‘dilateGrayLow’
leptonica-1.87.0/src/graymorph.c:609:9: call_function: calling ‘dilateGrayLow’ from ‘pixCloseGray’
leptonica-1.87.0/src/graymorph.c:609:9: return_function: returning to ‘pixCloseGray’ from ‘dilateGrayLow’
leptonica-1.87.0/src/graymorph.c:611:9: throw: if ‘pixSetOrClearBorder’ throws an exception...
leptonica-1.87.0/src/graymorph.c:611:9: danger: ‘array’ leaks here; was allocated at [(12)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/11)
#  609|           dilateGrayLow(datab, w, h, wplb, datat, wplt, vsize, L_VERT,
#  610|                         buffer, array);
#  611|->         pixSetOrClearBorder(pixb, leftpix, rightpix, toppix, bottompix,
#  612|                               PIX_SET);
#  613|           erodeGrayLow(datat, w, h, wplt, datab, wplb, hsize, L_HORIZ,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def787]
leptonica-1.87.0/src/graymorph.c:611:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/graymorph.c:520:1: enter_function: entry to ‘pixCloseGray’
leptonica-1.87.0/src/graymorph.c:531:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/graymorph.c:533:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:533:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:535:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:535:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:537:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:571:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:576:5: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:582:25: acquire_memory: allocated here
leptonica-1.87.0/src/graymorph.c:585:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/graymorph.c:590:8: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:590:8: branch_false: following ‘false’ branch (when ‘vsize != 1’)...
leptonica-1.87.0/src/graymorph.c:597:15: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:597:15: branch_false: following ‘false’ branch (when ‘hsize != 1’)...
leptonica-1.87.0/src/graymorph.c:605:9: branch_false: ...to here
leptonica-1.87.0/src/graymorph.c:605:9: call_function: calling ‘dilateGrayLow’ from ‘pixCloseGray’
leptonica-1.87.0/src/graymorph.c:605:9: return_function: returning to ‘pixCloseGray’ from ‘dilateGrayLow’
leptonica-1.87.0/src/graymorph.c:609:9: call_function: calling ‘dilateGrayLow’ from ‘pixCloseGray’
leptonica-1.87.0/src/graymorph.c:609:9: return_function: returning to ‘pixCloseGray’ from ‘dilateGrayLow’
leptonica-1.87.0/src/graymorph.c:611:9: throw: if ‘pixSetOrClearBorder’ throws an exception...
leptonica-1.87.0/src/graymorph.c:611:9: danger: ‘buffer’ leaks here; was allocated at [(12)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/11)
#  609|           dilateGrayLow(datab, w, h, wplb, datat, wplt, vsize, L_VERT,
#  610|                         buffer, array);
#  611|->         pixSetOrClearBorder(pixb, leftpix, rightpix, toppix, bottompix,
#  612|                               PIX_SET);
#  613|           erodeGrayLow(datat, w, h, wplt, datab, wplb, hsize, L_HORIZ,

Error: CPPCHECK_WARNING (CWE-758): [#def788]
leptonica-1.87.0/src/grayquant.c:556: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  554|                   dword |= ((gval - thresh) >> 30) & 2;
#  555|                   gval = sword & 0xf;
#  556|->                 dword |= ((gval - thresh) >> 31) & 1;
#  557|               }
#  558|               lined[dcount++] = dword;

Error: COMPILER_WARNING (CWE-457): [#def789]
leptonica-1.87.0/src/grayquant.c: scope_hint: In function ‘thresholdToBinaryLineLow’
leptonica-1.87.0/src/grayquant.c:568:21: warning[-Wmaybe-uninitialized]: ‘sword’ may be used uninitialized
#  568 |               sword <<= 4;
#      |               ~~~~~~^~~~~
leptonica-1.87.0/src/grayquant.c:524:10: note: ‘sword’ was declared here
#  524 | l_uint32 sword, dword;
#      |          ^~~~~
#  566|                 }
#  567|                 gval = (sword >> 28) & 0xf;
#  568|->               sword <<= 4;
#  569|                 dword |= (((gval - thresh) >> 31) & 1) << (31 - (j & 31));
#  570|             }

Error: CPPCHECK_WARNING (CWE-758): [#def790]
leptonica-1.87.0/src/grayquant.c:569: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  567|                 gval = (sword >> 28) & 0xf;
#  568|                 sword <<= 4;
#  569|->               dword |= (((gval - thresh) >> 31) & 1) << (31 - (j & 31));
#  570|             }
#  571|             lined[dcount] = dword;

Error: CPPCHECK_WARNING (CWE-758): [#def791]
leptonica-1.87.0/src/grayquant.c:597: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  595|                   dword |= ((gval - thresh) >> 30) & 2;
#  596|                   gval = sword & 0xff;
#  597|->                 dword |= ((gval - thresh) >> 31) & 1;
#  598|               }
#  599|               lined[dcount++] = dword;

Error: CPPCHECK_WARNING (CWE-758): [#def792]
leptonica-1.87.0/src/grayquant.c:610: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  608|                   gval = (sword >> 24) & 0xff;
#  609|                   sword <<= 8;
#  610|->                 dword |= (l_uint64)(((gval - thresh) >> 31) & 1)
#  611|                                << (31 - (j & 31));
#  612|               }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def793]
leptonica-1.87.0/src/grayquant.c:1272:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tabval’
leptonica-1.87.0/src/grayquant.c:1036:1: enter_function: entry to ‘pixDitherTo2bppSpec’
leptonica-1.87.0/src/grayquant.c:1051:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1053:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1053:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1055:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1055:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1058:17: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1058:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1060:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1073:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1082:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1082:5: call_function: calling ‘make8To2DitherTables’ from ‘pixDitherTo2bppSpec’
# 1270|       for (i = 0; i < 256; i++) {
# 1271|           if (i <= cliptoblack) {
# 1272|->             tabval[i] = 0;
# 1273|               tab38[i] = 0;
# 1274|               tab14[i] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def794]
leptonica-1.87.0/src/grayquant.c:1273:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab38’
leptonica-1.87.0/src/grayquant.c:1036:1: enter_function: entry to ‘pixDitherTo2bppSpec’
leptonica-1.87.0/src/grayquant.c:1051:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1053:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1053:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1055:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1055:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1058:17: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1058:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1060:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1073:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1082:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1082:5: call_function: calling ‘make8To2DitherTables’ from ‘pixDitherTo2bppSpec’
# 1271|           if (i <= cliptoblack) {
# 1272|               tabval[i] = 0;
# 1273|->             tab38[i] = 0;
# 1274|               tab14[i] = 0;
# 1275|           } else if (i < 43) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def795]
leptonica-1.87.0/src/grayquant.c:1274:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab14’
leptonica-1.87.0/src/grayquant.c:1265:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/grayquant.c:1270:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:1271:12: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:1271:12: branch_true: following ‘true’ branch (when ‘i <= cliptoblack’)...
leptonica-1.87.0/src/grayquant.c:1272:19: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:1274:13: danger: ‘tab14 + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1272|               tabval[i] = 0;
# 1273|               tab38[i] = 0;
# 1274|->             tab14[i] = 0;
# 1275|           } else if (i < 43) {
# 1276|               tabval[i] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def796]
leptonica-1.87.0/src/grayquant.c:1276:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tabval’
leptonica-1.87.0/src/grayquant.c:1036:1: enter_function: entry to ‘pixDitherTo2bppSpec’
leptonica-1.87.0/src/grayquant.c:1051:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1053:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1053:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1055:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1055:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1058:17: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1058:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1060:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1073:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1082:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1082:5: call_function: calling ‘make8To2DitherTables’ from ‘pixDitherTo2bppSpec’
# 1274|               tab14[i] = 0;
# 1275|           } else if (i < 43) {
# 1276|->             tabval[i] = 0;
# 1277|               tab38[i] = (3 * i + 4) / 8;
# 1278|               tab14[i] = (i + 2) / 4;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def797]
leptonica-1.87.0/src/grayquant.c:1277:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab38’
leptonica-1.87.0/src/grayquant.c:1036:1: enter_function: entry to ‘pixDitherTo2bppSpec’
leptonica-1.87.0/src/grayquant.c:1051:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1053:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1053:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1055:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1055:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1058:17: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1058:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1060:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1073:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1082:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1082:5: call_function: calling ‘make8To2DitherTables’ from ‘pixDitherTo2bppSpec’
# 1275|           } else if (i < 43) {
# 1276|               tabval[i] = 0;
# 1277|->             tab38[i] = (3 * i + 4) / 8;
# 1278|               tab14[i] = (i + 2) / 4;
# 1279|           } else if (i < 85) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def798]
leptonica-1.87.0/src/grayquant.c:1278:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab14’
leptonica-1.87.0/src/grayquant.c:1265:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/grayquant.c:1270:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:1271:12: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:1271:12: branch_false: following ‘false’ branch (when ‘i > cliptoblack’)...
leptonica-1.87.0/src/grayquant.c:1275:19: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1275:19: branch_true: following ‘true’ branch (when ‘i <= 42’)...
leptonica-1.87.0/src/grayquant.c:1276:19: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:1278:13: danger: ‘tab14 + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1276|               tabval[i] = 0;
# 1277|               tab38[i] = (3 * i + 4) / 8;
# 1278|->             tab14[i] = (i + 2) / 4;
# 1279|           } else if (i < 85) {
# 1280|               tabval[i] = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def799]
leptonica-1.87.0/src/grayquant.c:1830:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/grayquant.c:1825:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/grayquant.c:1826:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:1826:17: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:1827:21: branch_true: following ‘true’ branch (when ‘j < nlevels’)...
leptonica-1.87.0/src/grayquant.c:1828:29: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:1829:16: branch_true: following ‘true’ branch (when ‘i <= thresh’)...
leptonica-1.87.0/src/grayquant.c:1830:20: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:1830:17: danger: ‘tab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 1828|               thresh = 255 * (2 * j + 1) / (2 * nlevels - 2);
# 1829|               if (i <= thresh) {
# 1830|->                 tab[i] = j;
# 1831|   /*                lept_stderr("tab[%d] = %d\n", i, j); */
# 1832|                   break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def800]
leptonica-1.87.0/src/grayquant.c:1884:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/grayquant.c:1875:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/grayquant.c:1879:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:1879:17: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:1880:21: branch_true: following ‘true’ branch (when ‘nlevels > j’)...
leptonica-1.87.0/src/grayquant.c:1881:29: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:1882:16: branch_true: following ‘true’ branch (when ‘i <= thresh’)...
leptonica-1.87.0/src/grayquant.c:1883:28: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:1884:17: danger: ‘tab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1882|               if (i <= thresh) {
# 1883|                   quantval = maxval * j / (nlevels - 1);
# 1884|->                 tab[i] = quantval;
# 1885|   /*                lept_stderr("tab[%d] = %d\n", i, tab[i]); */
# 1886|                   break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def801]
leptonica-1.87.0/src/grayquant.c:1952:9: warning[-Wanalyzer-malloc-leak]: leak of ‘qtab’
leptonica-1.87.0/src/grayquant.c:1712:1: enter_function: entry to ‘pixThresholdGrayArb’
leptonica-1.87.0/src/grayquant.c:1726:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:1728:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1729:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1731:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1731:8: branch_false: following ‘false’ branch (when ‘edgevals’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:1733:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1739:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1743:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1757:5: call_function: calling ‘makeGrayQuantTableArb’ from ‘pixThresholdGrayArb’
# 1950|       jstart = 0;
# 1951|       for (i = 0; i < n; i++) {
# 1952|->         numaGetIValue(na, i, &val);
# 1953|           ave = (jstart + val) / 2;
# 1954|           pixcmapAddColor(cmap, ave, ave, ave);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def802]
leptonica-1.87.0/src/grayquant.c:1954:9: warning[-Wanalyzer-malloc-leak]: leak of ‘qtab’
leptonica-1.87.0/src/grayquant.c:1712:1: enter_function: entry to ‘pixThresholdGrayArb’
leptonica-1.87.0/src/grayquant.c:1726:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:1728:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1729:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1731:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1731:8: branch_false: following ‘false’ branch (when ‘edgevals’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:1733:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1739:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:1743:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:1757:5: call_function: calling ‘makeGrayQuantTableArb’ from ‘pixThresholdGrayArb’
# 1952|           numaGetIValue(na, i, &val);
# 1953|           ave = (jstart + val) / 2;
# 1954|->         pixcmapAddColor(cmap, ave, ave, ave);
# 1955|           for (j = jstart; j < val; j++)
# 1956|               tab[j] = i;

Error: CPPCHECK_WARNING (CWE-476): [#def803]
leptonica-1.87.0/src/grayquant.c:1956: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 1954|           pixcmapAddColor(cmap, ave, ave, ave);
# 1955|           for (j = jstart; j < val; j++)
# 1956|->             tab[j] = i;
# 1957|           jstart = val;
# 1958|       }

Error: CPPCHECK_WARNING (CWE-476): [#def804]
leptonica-1.87.0/src/grayquant.c:1964: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 1962|       pixcmapAddColor(cmap, ave, ave, ave);
# 1963|       for (j = jstart; j < 256; j++)
# 1964|->         tab[j] = n;
# 1965|   
# 1966|       return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def805]
leptonica-1.87.0/src/grayquant.c:2024:12: warning[-Wanalyzer-malloc-leak]: leak of ‘binave’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:30: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2024:12: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2024:12: danger: ‘binave’ leaks here; was allocated at [(13)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/12)
# 2022|       factor = (l_int32)(sqrt((l_float64)(w * h) / 30000.) + 0.5);
# 2023|       factor = L_MAX(1, factor);
# 2024|->     data = pixGetData(pixs);
# 2025|       wpl = pixGetWpl(pixs);
# 2026|       for (i = 0; i < h; i += factor) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def806]
leptonica-1.87.0/src/grayquant.c:2024:12: warning[-Wanalyzer-malloc-leak]: leak of ‘bincount’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:32: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2024:12: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2024:12: danger: ‘bincount’ leaks here; was allocated at [(11)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/10)
# 2022|       factor = (l_int32)(sqrt((l_float64)(w * h) / 30000.) + 0.5);
# 2023|       factor = L_MAX(1, factor);
# 2024|->     data = pixGetData(pixs);
# 2025|       wpl = pixGetWpl(pixs);
# 2026|       for (i = 0; i < h; i += factor) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def807]
leptonica-1.87.0/src/grayquant.c:2025:11: warning[-Wanalyzer-malloc-leak]: leak of ‘binave’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:30: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2025:11: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2025:11: danger: ‘binave’ leaks here; was allocated at [(13)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/12)
# 2023|       factor = L_MAX(1, factor);
# 2024|       data = pixGetData(pixs);
# 2025|->     wpl = pixGetWpl(pixs);
# 2026|       for (i = 0; i < h; i += factor) {
# 2027|           line = data + i * wpl;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def808]
leptonica-1.87.0/src/grayquant.c:2025:11: warning[-Wanalyzer-malloc-leak]: leak of ‘bincount’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:32: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2025:11: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2025:11: danger: ‘bincount’ leaks here; was allocated at [(11)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/10)
# 2023|       factor = L_MAX(1, factor);
# 2024|       data = pixGetData(pixs);
# 2025|->     wpl = pixGetWpl(pixs);
# 2026|       for (i = 0; i < h; i += factor) {
# 2027|           line = data + i * wpl;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def809]
leptonica-1.87.0/src/grayquant.c:2045:14: warning[-Wanalyzer-malloc-leak]: leak of ‘binave’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:30: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2037:28: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:2038:16: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2045:14: throw: if ‘pixcmapCreate’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2045:14: danger: ‘binave’ leaks here; was allocated at [(13)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/12)
# 2043|           /* Get the averages.  If there are no samples in a bin, use
# 2044|            * the center value of the bin. */
# 2045|->     *pcmap = pixcmapCreate(outdepth);
# 2046|       for (i = 0; i < nbins; i++) {
# 2047|           if (bincount[i]) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def810]
leptonica-1.87.0/src/grayquant.c:2045:14: warning[-Wanalyzer-malloc-leak]: leak of ‘bincount’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:32: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2037:28: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:2038:16: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2045:14: throw: if ‘pixcmapCreate’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2045:14: danger: ‘bincount’ leaks here; was allocated at [(11)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/10)
# 2043|           /* Get the averages.  If there are no samples in a bin, use
# 2044|            * the center value of the bin. */
# 2045|->     *pcmap = pixcmapCreate(outdepth);
# 2046|       for (i = 0; i < nbins; i++) {
# 2047|           if (bincount[i]) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def811]
leptonica-1.87.0/src/grayquant.c:2045:14: warning[-Wanalyzer-malloc-leak]: leak of ‘binstart’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2036:27: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2037:28: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:2038:16: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2045:14: throw: if ‘pixcmapCreate’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2045:14: danger: ‘binstart’ leaks here; was allocated at [(15)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/14)
# 2043|           /* Get the averages.  If there are no samples in a bin, use
# 2044|            * the center value of the bin. */
# 2045|->     *pcmap = pixcmapCreate(outdepth);
# 2046|       for (i = 0; i < nbins; i++) {
# 2047|           if (bincount[i]) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def812]
leptonica-1.87.0/src/grayquant.c:2051:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘binstart’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2036:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/grayquant.c:2037:28: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:2038:16: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2046:17: branch_true: following ‘true’ branch (when ‘i < nbins’)...
leptonica-1.87.0/src/grayquant.c:2047:21: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2047:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2050:16: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2050:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/grayquant.c:2051:32: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2051:24: danger: ‘binstart + (long unsigned int)i * 4’ could be NULL: unchecked value from [(15)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/14)
# 2049|           } else {  /* no samples in the bin */
# 2050|               if (i < nbins - 1)
# 2051|->                 val = (binstart[i] + binstart[i + 1]) / 2;
# 2052|               else  /* last bin */
# 2053|                   val = (binstart[i] + 255) / 2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def813]
leptonica-1.87.0/src/grayquant.c:2053:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘binstart’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2036:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/grayquant.c:2037:28: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:2038:16: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2046:17: branch_true: following ‘true’ branch (when ‘i < nbins’)...
leptonica-1.87.0/src/grayquant.c:2047:21: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2047:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2050:16: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2050:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2053:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2053:24: danger: ‘binstart + (long unsigned int)i * 4’ could be NULL: unchecked value from [(15)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/14)
# 2051|                   val = (binstart[i] + binstart[i + 1]) / 2;
# 2052|               else  /* last bin */
# 2053|->                 val = (binstart[i] + 255) / 2;
# 2054|           }
# 2055|           pixcmapAddColor(*pcmap, val, val, val);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def814]
leptonica-1.87.0/src/grayquant.c:2055:9: warning[-Wanalyzer-malloc-leak]: leak of ‘binave’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:30: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2037:28: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:2038:16: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2046:17: branch_true: following ‘true’ branch (when ‘i < nbins’)...
leptonica-1.87.0/src/grayquant.c:2047:21: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2047:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/grayquant.c:2048:25: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2055:9: throw: if ‘pixcmapAddColor’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2055:9: danger: ‘binave’ leaks here; was allocated at [(13)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/12)
# 2053|                   val = (binstart[i] + 255) / 2;
# 2054|           }
# 2055|->         pixcmapAddColor(*pcmap, val, val, val);
# 2056|       }
# 2057|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def815]
leptonica-1.87.0/src/grayquant.c:2055:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bincount’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:32: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2037:28: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:2038:16: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2046:17: branch_true: following ‘true’ branch (when ‘i < nbins’)...
leptonica-1.87.0/src/grayquant.c:2047:21: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2047:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/grayquant.c:2048:25: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2055:9: throw: if ‘pixcmapAddColor’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2055:9: danger: ‘bincount’ leaks here; was allocated at [(11)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/10)
# 2053|                   val = (binstart[i] + 255) / 2;
# 2054|           }
# 2055|->         pixcmapAddColor(*pcmap, val, val, val);
# 2056|       }
# 2057|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def816]
leptonica-1.87.0/src/grayquant.c:2055:9: warning[-Wanalyzer-malloc-leak]: leak of ‘binstart’
leptonica-1.87.0/src/grayquant.c:2001:8: branch_false: following ‘false’ branch (when ‘pcmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2003:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2004:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2006:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2009:8: branch_false: following ‘false’ branch (when ‘tab’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2011:13: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2012:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2016:32: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2016:8: branch_false: following ‘false’ branch (when ‘bincount’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2018:30: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2018:8: branch_false: following ‘false’ branch (when ‘binave’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2022:40: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2036:27: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2037:28: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:2038:16: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2046:17: branch_true: following ‘true’ branch (when ‘i < nbins’)...
leptonica-1.87.0/src/grayquant.c:2047:21: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2047:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/grayquant.c:2048:25: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2055:9: throw: if ‘pixcmapAddColor’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2055:9: danger: ‘binstart’ leaks here; was allocated at [(15)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/14)
# 2053|                   val = (binstart[i] + 255) / 2;
# 2054|           }
# 2055|->         pixcmapAddColor(*pcmap, val, val, val);
# 2056|       }
# 2057|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def817]
leptonica-1.87.0/src/grayquant.c:2456:13: warning[-Wanalyzer-malloc-leak]: leak of ‘lut’
leptonica-1.87.0/src/grayquant.c:2303:1: enter_function: entry to ‘pixGrayQuantFromHisto’
leptonica-1.87.0/src/grayquant.c:2317:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2327:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2330:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2331:8: branch_true: following ‘true’ branch (when ‘pixd’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2332:13: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2332:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2334:21: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2334:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2336:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2337:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2342:12: branch_false: following ‘false’ branch (when ‘nestim <= 255’)...
leptonica-1.87.0/src/grayquant.c:2346:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2369:9: call_function: calling ‘numaFillCmapFromHisto’ from ‘pixGrayQuantFromHisto’
# 2454|       lut = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
# 2455|       *plut = lut;
# 2456|->     index = pixcmapGetCount(cmap);  /* start with number of colors
# 2457|                                        * already reserved */
# 2458|   

Error: CPPCHECK_WARNING (CWE-476): [#def818]
leptonica-1.87.0/src/grayquant.c:2472: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lut
# 2470|       ret = 0;
# 2471|       for (i = 0; i < 256; i++) {
# 2472|->         lut[i] = index;
# 2473|           sum += iahisto[i];
# 2474|           wtsum += i * iahisto[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def819]
leptonica-1.87.0/src/grayquant.c:2472:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lut’
leptonica-1.87.0/src/grayquant.c:2303:1: enter_function: entry to ‘pixGrayQuantFromHisto’
leptonica-1.87.0/src/grayquant.c:2317:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2327:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2330:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2331:8: branch_true: following ‘true’ branch (when ‘pixd’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2332:13: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2332:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2334:21: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2334:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2336:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2337:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2342:12: branch_false: following ‘false’ branch (when ‘nestim <= 255’)...
leptonica-1.87.0/src/grayquant.c:2346:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2369:9: call_function: calling ‘numaFillCmapFromHisto’ from ‘pixGrayQuantFromHisto’
# 2470|       ret = 0;
# 2471|       for (i = 0; i < 256; i++) {
# 2472|->         lut[i] = index;
# 2473|           sum += iahisto[i];
# 2474|           wtsum += i * iahisto[i];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def820]
leptonica-1.87.0/src/grayquant.c:2486:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lut’
leptonica-1.87.0/src/grayquant.c:2303:1: enter_function: entry to ‘pixGrayQuantFromHisto’
leptonica-1.87.0/src/grayquant.c:2317:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2327:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2330:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2331:8: branch_true: following ‘true’ branch (when ‘pixd’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2332:13: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2332:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2334:21: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2334:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2336:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2337:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2342:12: branch_false: following ‘false’ branch (when ‘nestim <= 255’)...
leptonica-1.87.0/src/grayquant.c:2346:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2369:9: call_function: calling ‘numaFillCmapFromHisto’ from ‘pixGrayQuantFromHisto’
# 2484|               /* Found new color; sum > 0 */
# 2485|           val = (l_int32)((l_float32)wtsum / (l_float32)sum + 0.5);
# 2486|->         ret = pixcmapAddColor(cmap, val, val, val);
# 2487|           istart = i + 1;
# 2488|           sum = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def821]
leptonica-1.87.0/src/grayquant.c:2559:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tab’
leptonica-1.87.0/src/grayquant.c:2533:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2535:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2535:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2539:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2540:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2542:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2542:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2544:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2557:22: acquire_memory: allocated here
leptonica-1.87.0/src/grayquant.c:2558:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:2559:9: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2559:9: throw: if ‘pixcmapGetNearestGrayIndex’ throws an exception...
leptonica-1.87.0/src/grayquant.c:2559:9: danger: ‘tab’ leaks here; was allocated at [(9)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/8)
# 2557|       tab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
# 2558|       for (i = 0; i < 256; i++) {
# 2559|->         pixcmapGetNearestGrayIndex(cmapd, i, &index);
# 2560|           tab[i] = index;
# 2561|       }

Error: CPPCHECK_WARNING (CWE-476): [#def822]
leptonica-1.87.0/src/grayquant.c:2560: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2558|       for (i = 0; i < 256; i++) {
# 2559|           pixcmapGetNearestGrayIndex(cmapd, i, &index);
# 2560|->         tab[i] = index;
# 2561|       }
# 2562|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def823]
leptonica-1.87.0/src/grayquant.c:2560:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/grayquant.c:2533:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2535:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2535:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2539:5: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2540:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/grayquant.c:2542:8: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2542:8: branch_false: following ‘false’ branch (when ‘cmap’ is non-NULL)...
leptonica-1.87.0/src/grayquant.c:2544:9: branch_false: ...to here
leptonica-1.87.0/src/grayquant.c:2557:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/grayquant.c:2558:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/grayquant.c:2559:9: branch_true: ...to here
leptonica-1.87.0/src/grayquant.c:2560:9: danger: ‘tab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/8)
# 2558|       for (i = 0; i < 256; i++) {
# 2559|           pixcmapGetNearestGrayIndex(cmapd, i, &index);
# 2560|->         tab[i] = index;
# 2561|       }
# 2562|   

Error: CPPCHECK_WARNING (CWE-476): [#def824]
leptonica-1.87.0/src/grayquant.c:2578: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2576|           for (j = 0; j < w; j++) {
# 2577|               vals = GET_DATA_BYTE(lines, j);
# 2578|->             vald = tab[vals];
# 2579|               if (depth == 2)
# 2580|                   SET_DATA_DIBIT(lined, j, vald);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def825]
leptonica-1.87.0/src/hashmap.c:123:5: warning[-Wanalyzer-malloc-leak]: leak of ‘hmap’
leptonica-1.87.0/src/hashmap.c:116:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/hashmap.c:122:25: branch_false: ...to here
leptonica-1.87.0/src/hashmap.c:122:25: acquire_memory: allocated here
leptonica-1.87.0/src/hashmap.c:123:5: throw: if ‘findNextLargerPrime’ throws an exception...
leptonica-1.87.0/src/hashmap.c:123:5: danger: ‘hmap’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  121|   
#  122|       hmap = (L_HASHMAP *)LEPT_CALLOC(1, sizeof(L_HASHMAP));
#  123|->     findNextLargerPrime(size, &tabsize);  /* at least 101 */
#  124|       if ((hmap->hashtab =
#  125|           (L_HASHITEM **)LEPT_CALLOC(tabsize, sizeof(L_HASHITEM *))) == NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def826]
leptonica-1.87.0/src/hashmap.c:124: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hmap
#  122|       hmap = (L_HASHMAP *)LEPT_CALLOC(1, sizeof(L_HASHMAP));
#  123|       findNextLargerPrime(size, &tabsize);  /* at least 101 */
#  124|->     if ((hmap->hashtab =
#  125|           (L_HASHITEM **)LEPT_CALLOC(tabsize, sizeof(L_HASHITEM *))) == NULL) {
#  126|           LEPT_FREE(hmap);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def827]
leptonica-1.87.0/src/hashmap.c:124:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘hmap’
leptonica-1.87.0/src/hashmap.c:116:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/hashmap.c:122:25: branch_false: ...to here
leptonica-1.87.0/src/hashmap.c:122:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/hashmap.c:124:9: danger: ‘hmap’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  122|       hmap = (L_HASHMAP *)LEPT_CALLOC(1, sizeof(L_HASHMAP));
#  123|       findNextLargerPrime(size, &tabsize);  /* at least 101 */
#  124|->     if ((hmap->hashtab =
#  125|           (L_HASHITEM **)LEPT_CALLOC(tabsize, sizeof(L_HASHITEM *))) == NULL) {
#  126|           LEPT_FREE(hmap);

Error: CPPCHECK_WARNING (CWE-476): [#def828]
leptonica-1.87.0/src/hashmap.c:130: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hmap
#  128|       }
#  129|   
#  130|->     hmap->nitems = 0;
#  131|       hmap->ntogo = ninit;
#  132|       hmap->maxocc = maxocc;

Error: CPPCHECK_WARNING (CWE-476): [#def829]
leptonica-1.87.0/src/hashmap.c:131: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hmap
#  129|   
#  130|       hmap->nitems = 0;
#  131|->     hmap->ntogo = ninit;
#  132|       hmap->maxocc = maxocc;
#  133|       hmap->tabsize = tabsize;

Error: CPPCHECK_WARNING (CWE-476): [#def830]
leptonica-1.87.0/src/hashmap.c:132: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hmap
#  130|       hmap->nitems = 0;
#  131|       hmap->ntogo = ninit;
#  132|->     hmap->maxocc = maxocc;
#  133|       hmap->tabsize = tabsize;
#  134|       return hmap;

Error: CPPCHECK_WARNING (CWE-476): [#def831]
leptonica-1.87.0/src/hashmap.c:133: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hmap
#  131|       hmap->ntogo = ninit;
#  132|       hmap->maxocc = maxocc;
#  133|->     hmap->tabsize = tabsize;
#  134|       return hmap;
#  135|   }

Error: CPPCHECK_WARNING (CWE-476): [#def832]
leptonica-1.87.0/src/hashmap.c:226: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hitem
#  224|            * Make a new hitem and add to the head of the list */
#  225|       hitem = (L_HASHITEM *)LEPT_CALLOC(1, sizeof(L_HASHITEM));
#  226|->     hitem->key = key;
#  227|       hitem->val = val;
#  228|       hitem->count = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def833]
leptonica-1.87.0/src/hashmap.c:226:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘hitem’
leptonica-1.87.0/src/hashmap.c:207:8: branch_false: following ‘false’ branch (when ‘hmap’ is non-NULL)...
leptonica-1.87.0/src/hashmap.c:209:9: branch_false: ...to here
leptonica-1.87.0/src/hashmap.c:209:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/hashmap.c:213:19: branch_false: ...to here
leptonica-1.87.0/src/hashmap.c:221:8: branch_false: following ‘false’ branch (when ‘op != 1’)...
leptonica-1.87.0/src/hashmap.c:225:27: branch_false: ...to here
leptonica-1.87.0/src/hashmap.c:225:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/hashmap.c:226:5: danger: ‘hitem’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  224|            * Make a new hitem and add to the head of the list */
#  225|       hitem = (L_HASHITEM *)LEPT_CALLOC(1, sizeof(L_HASHITEM));
#  226|->     hitem->key = key;
#  227|       hitem->val = val;
#  228|       hitem->count = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def834]
leptonica-1.87.0/src/hashmap.c:227: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hitem
#  225|       hitem = (L_HASHITEM *)LEPT_CALLOC(1, sizeof(L_HASHITEM));
#  226|       hitem->key = key;
#  227|->     hitem->val = val;
#  228|       hitem->count = 1;
#  229|       hitem->next = hlist;

Error: CPPCHECK_WARNING (CWE-476): [#def835]
leptonica-1.87.0/src/hashmap.c:228: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hitem
#  226|       hitem->key = key;
#  227|       hitem->val = val;
#  228|->     hitem->count = 1;
#  229|       hitem->next = hlist;
#  230|       hmap->hashtab[index] = hitem;

Error: CPPCHECK_WARNING (CWE-476): [#def836]
leptonica-1.87.0/src/hashmap.c:229: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: hitem
#  227|       hitem->val = val;
#  228|       hitem->count = 1;
#  229|->     hitem->next = hlist;
#  230|       hmap->hashtab[index] = hitem;
#  231|       hmap->nitems++;

Error: CPPCHECK_WARNING (CWE-476): [#def837]
leptonica-1.87.0/src/heap.c:122: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lh
#  120|           /* Allocate ptr array and initialize counters. */
#  121|       lh = (L_HEAP *)LEPT_CALLOC(1, sizeof(L_HEAP));
#  122|->     if ((lh->array = (void **)LEPT_CALLOC(n, sizeof(void *))) == NULL) {
#  123|           lheapDestroy(&lh, FALSE);
#  124|           return (L_HEAP *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def838]
leptonica-1.87.0/src/heap.c:126: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lh
#  124|           return (L_HEAP *)ERROR_PTR("ptr array not made", __func__, NULL);
#  125|       }
#  126|->     lh->nalloc = n;
#  127|       lh->n = 0;
#  128|       lh->direction = direction;

Error: CPPCHECK_WARNING (CWE-476): [#def839]
leptonica-1.87.0/src/heap.c:127: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lh
#  125|       }
#  126|       lh->nalloc = n;
#  127|->     lh->n = 0;
#  128|       lh->direction = direction;
#  129|       return lh;

Error: CPPCHECK_WARNING (CWE-476): [#def840]
leptonica-1.87.0/src/heap.c:128: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lh
#  126|       lh->nalloc = n;
#  127|       lh->n = 0;
#  128|->     lh->direction = direction;
#  129|       return lh;
#  130|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def841]
leptonica-1.87.0/src/jbclass.c:1082:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1082:15: throw: if ‘makePixelCentroidTab8’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1082:15: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
# 1080|       pixcts = (l_int32 *)LEPT_CALLOC(n, sizeof(*pixcts));
# 1081|       pixrowcts = (l_int32 **)LEPT_CALLOC(n, sizeof(*pixrowcts));
# 1082|->     centtab = makePixelCentroidTab8();
# 1083|   
# 1084|           /* Count the "1" pixels in each row of the pix in pixa1; this

Error: GCC_ANALYZER_WARNING (CWE-401): [#def842]
leptonica-1.87.0/src/jbclass.c:1082:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1082:15: throw: if ‘makePixelCentroidTab8’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1082:15: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
# 1080|       pixcts = (l_int32 *)LEPT_CALLOC(n, sizeof(*pixcts));
# 1081|       pixrowcts = (l_int32 **)LEPT_CALLOC(n, sizeof(*pixrowcts));
# 1082|->     centtab = makePixelCentroidTab8();
# 1083|   
# 1084|           /* Count the "1" pixels in each row of the pix in pixa1; this

Error: GCC_ANALYZER_WARNING (CWE-401): [#def843]
leptonica-1.87.0/src/jbclass.c:1091:11: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1091:11: throw: if ‘ptaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1091:11: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
# 1089|            * each (bordered) pix.  The pixrowcts[i][y] are the total number
# 1090|            * of fg pixels in pixa[i] below row y. */
# 1091|->     pta = ptaCreate(n);
# 1092|       for (i = 0; i < n; i++) {
# 1093|           pix = pixaGetPix(pixa1, i, L_CLONE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def844]
leptonica-1.87.0/src/jbclass.c:1091:11: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1091:11: throw: if ‘ptaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1091:11: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
# 1089|            * each (bordered) pix.  The pixrowcts[i][y] are the total number
# 1090|            * of fg pixels in pixa[i] below row y. */
# 1091|->     pta = ptaCreate(n);
# 1092|       for (i = 0; i < n; i++) {
# 1093|           pix = pixaGetPix(pixa1, i, L_CLONE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def845]
leptonica-1.87.0/src/jbclass.c:1093:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1093:15: throw: if ‘pixaGetPix’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1093:15: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/10)
# 1091|       pta = ptaCreate(n);
# 1092|       for (i = 0; i < n; i++) {
# 1093|->         pix = pixaGetPix(pixa1, i, L_CLONE);
# 1094|           pixrowcts[i] = (l_int32 *)LEPT_CALLOC(pixGetHeight(pix),
# 1095|                                            sizeof(**pixrowcts));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def846]
leptonica-1.87.0/src/jbclass.c:1093:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1093:15: throw: if ‘pixaGetPix’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1093:15: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 1091|       pta = ptaCreate(n);
# 1092|       for (i = 0; i < n; i++) {
# 1093|->         pix = pixaGetPix(pixa1, i, L_CLONE);
# 1094|           pixrowcts[i] = (l_int32 *)LEPT_CALLOC(pixGetHeight(pix),
# 1095|                                            sizeof(**pixrowcts));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def847]
leptonica-1.87.0/src/jbclass.c:1093:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1093:15: throw: if ‘pixaGetPix’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1093:15: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
# 1091|       pta = ptaCreate(n);
# 1092|       for (i = 0; i < n; i++) {
# 1093|->         pix = pixaGetPix(pixa1, i, L_CLONE);
# 1094|           pixrowcts[i] = (l_int32 *)LEPT_CALLOC(pixGetHeight(pix),
# 1095|                                            sizeof(**pixrowcts));

Error: CPPCHECK_WARNING (CWE-476): [#def848]
leptonica-1.87.0/src/jbclass.c:1094: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixrowcts
# 1092|       for (i = 0; i < n; i++) {
# 1093|           pix = pixaGetPix(pixa1, i, L_CLONE);
# 1094|->         pixrowcts[i] = (l_int32 *)LEPT_CALLOC(pixGetHeight(pix),
# 1095|                                            sizeof(**pixrowcts));
# 1096|           xsum = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def849]
leptonica-1.87.0/src/jbclass.c:1094:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:9: danger: ‘pixrowcts + (long unsigned int)i * 8’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8)
# 1092|       for (i = 0; i < n; i++) {
# 1093|           pix = pixaGetPix(pixa1, i, L_CLONE);
# 1094|->         pixrowcts[i] = (l_int32 *)LEPT_CALLOC(pixGetHeight(pix),
# 1095|                                            sizeof(**pixrowcts));
# 1096|           xsum = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def850]
leptonica-1.87.0/src/jbclass.c:1094:35: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1094:35: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/10)
# 1092|       for (i = 0; i < n; i++) {
# 1093|           pix = pixaGetPix(pixa1, i, L_CLONE);
# 1094|->         pixrowcts[i] = (l_int32 *)LEPT_CALLOC(pixGetHeight(pix),
# 1095|                                            sizeof(**pixrowcts));
# 1096|           xsum = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def851]
leptonica-1.87.0/src/jbclass.c:1094:35: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1094:35: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
# 1092|       for (i = 0; i < n; i++) {
# 1093|           pix = pixaGetPix(pixa1, i, L_CLONE);
# 1094|->         pixrowcts[i] = (l_int32 *)LEPT_CALLOC(pixGetHeight(pix),
# 1095|                                            sizeof(**pixrowcts));
# 1096|           xsum = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def852]
leptonica-1.87.0/src/jbclass.c:1094:35: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1094:35: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
# 1092|       for (i = 0; i < n; i++) {
# 1093|           pix = pixaGetPix(pixa1, i, L_CLONE);
# 1094|->         pixrowcts[i] = (l_int32 *)LEPT_CALLOC(pixGetHeight(pix),
# 1095|                                            sizeof(**pixrowcts));
# 1096|           xsum = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def853]
leptonica-1.87.0/src/jbclass.c:1098:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1098:15: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1098:15: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/10)
# 1096|           xsum = 0;
# 1097|           ysum = 0;
# 1098|->         wpl = pixGetWpl(pix);
# 1099|           row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def854]
leptonica-1.87.0/src/jbclass.c:1098:15: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)pixGetHeight(pixaGetPix(pixa1,  i, 2)), 4)’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1098:15: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1098:15: danger: ‘calloc((long unsigned int)pixGetHeight(pixaGetPix(pixa1,  i, 2)), 4)’ leaks here; was allocated at [(11)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/10)
# 1096|           xsum = 0;
# 1097|           ysum = 0;
# 1098|->         wpl = pixGetWpl(pix);
# 1099|           row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def855]
leptonica-1.87.0/src/jbclass.c:1098:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1098:15: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1098:15: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/8)
# 1096|           xsum = 0;
# 1097|           ysum = 0;
# 1098|->         wpl = pixGetWpl(pix);
# 1099|           row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def856]
leptonica-1.87.0/src/jbclass.c:1098:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1098:15: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1098:15: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
# 1096|           xsum = 0;
# 1097|           ysum = 0;
# 1098|->         wpl = pixGetWpl(pix);
# 1099|           row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def857]
leptonica-1.87.0/src/jbclass.c:1099:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1099:15: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1099:15: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/10)
# 1097|           ysum = 0;
# 1098|           wpl = pixGetWpl(pix);
# 1099|->         row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;
# 1101|           for (y = pixGetHeight(pix) - 1; y >= 0; y--, row -= wpl) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def858]
leptonica-1.87.0/src/jbclass.c:1099:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1099:15: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1099:15: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/8)
# 1097|           ysum = 0;
# 1098|           wpl = pixGetWpl(pix);
# 1099|->         row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;
# 1101|           for (y = pixGetHeight(pix) - 1; y >= 0; y--, row -= wpl) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def859]
leptonica-1.87.0/src/jbclass.c:1099:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1099:15: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1099:15: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/8)
# 1097|           ysum = 0;
# 1098|           wpl = pixGetWpl(pix);
# 1099|->         row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;
# 1101|           for (y = pixGetHeight(pix) - 1; y >= 0; y--, row -= wpl) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def860]
leptonica-1.87.0/src/jbclass.c:1099:34: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1099:34: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1099:34: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/10)
# 1097|           ysum = 0;
# 1098|           wpl = pixGetWpl(pix);
# 1099|->         row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;
# 1101|           for (y = pixGetHeight(pix) - 1; y >= 0; y--, row -= wpl) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def861]
leptonica-1.87.0/src/jbclass.c:1099:34: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1099:34: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1099:34: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/8)
# 1097|           ysum = 0;
# 1098|           wpl = pixGetWpl(pix);
# 1099|->         row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;
# 1101|           for (y = pixGetHeight(pix) - 1; y >= 0; y--, row -= wpl) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def862]
leptonica-1.87.0/src/jbclass.c:1099:34: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1099:34: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1099:34: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/8)
# 1097|           ysum = 0;
# 1098|           wpl = pixGetWpl(pix);
# 1099|->         row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;
# 1101|           for (y = pixGetHeight(pix) - 1; y >= 0; y--, row -= wpl) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def863]
leptonica-1.87.0/src/jbclass.c:1101:18: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:18: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1101:18: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/10)
# 1099|           row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;
# 1101|->         for (y = pixGetHeight(pix) - 1; y >= 0; y--, row -= wpl) {
# 1102|               pixrowcts[i][y] = downcount;
# 1103|               rowcount = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def864]
leptonica-1.87.0/src/jbclass.c:1101:18: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:18: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1101:18: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/8)
# 1099|           row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;
# 1101|->         for (y = pixGetHeight(pix) - 1; y >= 0; y--, row -= wpl) {
# 1102|               pixrowcts[i][y] = downcount;
# 1103|               rowcount = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def865]
leptonica-1.87.0/src/jbclass.c:1101:18: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:18: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1101:18: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/8)
# 1099|           row = pixGetData(pix) + (pixGetHeight(pix) - 1) * wpl;
# 1100|           downcount = 0;
# 1101|->         for (y = pixGetHeight(pix) - 1; y >= 0; y--, row -= wpl) {
# 1102|               pixrowcts[i][y] = downcount;
# 1103|               rowcount = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def866]
leptonica-1.87.0/src/jbclass.c:1102: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixrowcts
# 1100|           downcount = 0;
# 1101|           for (y = pixGetHeight(pix) - 1; y >= 0; y--, row -= wpl) {
# 1102|->             pixrowcts[i][y] = downcount;
# 1103|               rowcount = 0;
# 1104|               for (x = 0; x < wpl; x++) {

Error: CPPCHECK_WARNING (CWE-476): [#def867]
leptonica-1.87.0/src/jbclass.c:1122: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixcts
# 1120|               ysum += rowcount * y;
# 1121|           }
# 1122|->         pixcts[i] = downcount;
# 1123|           if (downcount > 0) {
# 1124|               ptaAddPt(pta,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def868]
leptonica-1.87.0/src/jbclass.c:1122:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1122:9: danger: ‘pixcts + (long unsigned int)i * 4’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/8)
# 1120|               ysum += rowcount * y;
# 1121|           }
# 1122|->         pixcts[i] = downcount;
# 1123|           if (downcount > 0) {
# 1124|               ptaAddPt(pta,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def869]
leptonica-1.87.0/src/jbclass.c:1127:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1127:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1127:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1127:13: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/10)
# 1125|                    xsum / (l_float32)downcount, ysum / (l_float32)downcount);
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|->             L_ERROR("downcount == 0 !\n", __func__);
# 1128|               ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def870]
leptonica-1.87.0/src/jbclass.c:1127:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1127:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1127:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1127:13: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/8)
# 1125|                    xsum / (l_float32)downcount, ysum / (l_float32)downcount);
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|->             L_ERROR("downcount == 0 !\n", __func__);
# 1128|               ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def871]
leptonica-1.87.0/src/jbclass.c:1127:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1127:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1127:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1127:13: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/8)
# 1125|                    xsum / (l_float32)downcount, ysum / (l_float32)downcount);
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|->             L_ERROR("downcount == 0 !\n", __func__);
# 1128|               ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def872]
leptonica-1.87.0/src/jbclass.c:1128:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1128:13: throw: if ‘ptaAddPt’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1128:13: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/10)
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|               L_ERROR("downcount == 0 !\n", __func__);
# 1128|->             ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|           pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def873]
leptonica-1.87.0/src/jbclass.c:1128:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1128:13: throw: if ‘ptaAddPt’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1128:13: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/8)
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|               L_ERROR("downcount == 0 !\n", __func__);
# 1128|->             ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|           pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def874]
leptonica-1.87.0/src/jbclass.c:1128:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1128:13: throw: if ‘ptaAddPt’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1128:13: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/8)
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|               L_ERROR("downcount == 0 !\n", __func__);
# 1128|->             ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|           pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def875]
leptonica-1.87.0/src/jbclass.c:1128:27: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1128:27: throw: if ‘pixGetWidth’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1128:27: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/10)
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|               L_ERROR("downcount == 0 !\n", __func__);
# 1128|->             ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|           pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def876]
leptonica-1.87.0/src/jbclass.c:1128:27: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1128:27: throw: if ‘pixGetWidth’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1128:27: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/8)
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|               L_ERROR("downcount == 0 !\n", __func__);
# 1128|->             ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|           pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def877]
leptonica-1.87.0/src/jbclass.c:1128:27: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1128:27: throw: if ‘pixGetWidth’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1128:27: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/8)
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|               L_ERROR("downcount == 0 !\n", __func__);
# 1128|->             ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|           pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def878]
leptonica-1.87.0/src/jbclass.c:1128:49: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1128:49: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1128:49: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/10)
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|               L_ERROR("downcount == 0 !\n", __func__);
# 1128|->             ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|           pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def879]
leptonica-1.87.0/src/jbclass.c:1128:49: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1128:49: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1128:49: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/8)
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|               L_ERROR("downcount == 0 !\n", __func__);
# 1128|->             ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|           pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def880]
leptonica-1.87.0/src/jbclass.c:1128:49: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1128:49: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1128:49: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/47/codeFlows/0/threadFlows/0/locations/8)
# 1126|           } else {  /* no pixels; shouldn't happen */
# 1127|               L_ERROR("downcount == 0 !\n", __func__);
# 1128|->             ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|           pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def881]
leptonica-1.87.0/src/jbclass.c:1130:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1130:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1130:9: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/10)
# 1128|               ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|->         pixDestroy(&pix);
# 1131|       }
# 1132|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def882]
leptonica-1.87.0/src/jbclass.c:1130:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1130:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1130:9: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/8)
# 1128|               ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|->         pixDestroy(&pix);
# 1131|       }
# 1132|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def883]
leptonica-1.87.0/src/jbclass.c:1130:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1130:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1130:9: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/8)
# 1128|               ptaAddPt(pta, pixGetWidth(pix) / 2, pixGetHeight(pix) / 2);
# 1129|           }
# 1130|->         pixDestroy(&pix);
# 1131|       }
# 1132|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def884]
leptonica-1.87.0/src/jbclass.c:1134:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1134:5: throw: if ‘ptaJoin’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1134:5: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/10)
# 1132|   
# 1133|       ptac = classer->ptac;  /* holds centroids of components up to this page */
# 1134|->     ptaJoin(ptac, pta, 0, -1);  /* save centroids of all components */
# 1135|       ptact = classer->ptact;  /* holds centroids of templates */
# 1136|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def885]
leptonica-1.87.0/src/jbclass.c:1134:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1134:5: throw: if ‘ptaJoin’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1134:5: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/8)
# 1132|   
# 1133|       ptac = classer->ptac;  /* holds centroids of components up to this page */
# 1134|->     ptaJoin(ptac, pta, 0, -1);  /* save centroids of all components */
# 1135|       ptact = classer->ptact;  /* holds centroids of templates */
# 1136|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def886]
leptonica-1.87.0/src/jbclass.c:1134:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1134:5: throw: if ‘ptaJoin’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1134:5: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/8)
# 1132|   
# 1133|       ptac = classer->ptac;  /* holds centroids of components up to this page */
# 1134|->     ptaJoin(ptac, pta, 0, -1);  /* save centroids of all components */
# 1135|       ptact = classer->ptact;  /* holds centroids of templates */
# 1136|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def887]
leptonica-1.87.0/src/jbclass.c:1176:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1176:16: throw: if ‘pixaGetPix’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1176:16: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/10)
# 1174|       dahash = classer->dahash;
# 1175|       for (i = 0; i < n; i++) {
# 1176|->         pix1 = pixaGetPix(pixa1, i, L_CLONE);
# 1177|           area1 = pixcts[i];
# 1178|           ptaGetPt(pta, i, &x1, &y1);  /* centroid for this instance */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def888]
leptonica-1.87.0/src/jbclass.c:1176:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1176:16: throw: if ‘pixaGetPix’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1176:16: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/57/codeFlows/0/threadFlows/0/locations/8)
# 1174|       dahash = classer->dahash;
# 1175|       for (i = 0; i < n; i++) {
# 1176|->         pix1 = pixaGetPix(pixa1, i, L_CLONE);
# 1177|           area1 = pixcts[i];
# 1178|           ptaGetPt(pta, i, &x1, &y1);  /* centroid for this instance */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def889]
leptonica-1.87.0/src/jbclass.c:1176:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1176:16: throw: if ‘pixaGetPix’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1176:16: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/58/codeFlows/0/threadFlows/0/locations/8)
# 1174|       dahash = classer->dahash;
# 1175|       for (i = 0; i < n; i++) {
# 1176|->         pix1 = pixaGetPix(pixa1, i, L_CLONE);
# 1177|           area1 = pixcts[i];
# 1178|           ptaGetPt(pta, i, &x1, &y1);  /* centroid for this instance */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def890]
leptonica-1.87.0/src/jbclass.c:1178:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1178:9: throw: if ‘ptaGetPt’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1178:9: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/59/codeFlows/0/threadFlows/0/locations/10)
# 1176|           pix1 = pixaGetPix(pixa1, i, L_CLONE);
# 1177|           area1 = pixcts[i];
# 1178|->         ptaGetPt(pta, i, &x1, &y1);  /* centroid for this instance */
# 1179|           nt = pixaGetCount(pixat);
# 1180|           found = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def891]
leptonica-1.87.0/src/jbclass.c:1178:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1178:9: throw: if ‘ptaGetPt’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1178:9: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/60/codeFlows/0/threadFlows/0/locations/8)
# 1176|           pix1 = pixaGetPix(pixa1, i, L_CLONE);
# 1177|           area1 = pixcts[i];
# 1178|->         ptaGetPt(pta, i, &x1, &y1);  /* centroid for this instance */
# 1179|           nt = pixaGetCount(pixat);
# 1180|           found = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def892]
leptonica-1.87.0/src/jbclass.c:1178:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1178:9: throw: if ‘ptaGetPt’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1178:9: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/61/codeFlows/0/threadFlows/0/locations/8)
# 1176|           pix1 = pixaGetPix(pixa1, i, L_CLONE);
# 1177|           area1 = pixcts[i];
# 1178|->         ptaGetPt(pta, i, &x1, &y1);  /* centroid for this instance */
# 1179|           nt = pixaGetCount(pixat);
# 1180|           found = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def893]
leptonica-1.87.0/src/jbclass.c:1179:14: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1179:14: throw: if ‘pixaGetCount’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1179:14: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/62/codeFlows/0/threadFlows/0/locations/10)
# 1177|           area1 = pixcts[i];
# 1178|           ptaGetPt(pta, i, &x1, &y1);  /* centroid for this instance */
# 1179|->         nt = pixaGetCount(pixat);
# 1180|           found = FALSE;
# 1181|           findcontext = findSimilarSizedTemplatesInit(classer, pix1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def894]
leptonica-1.87.0/src/jbclass.c:1179:14: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1179:14: throw: if ‘pixaGetCount’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1179:14: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/63/codeFlows/0/threadFlows/0/locations/8)
# 1177|           area1 = pixcts[i];
# 1178|           ptaGetPt(pta, i, &x1, &y1);  /* centroid for this instance */
# 1179|->         nt = pixaGetCount(pixat);
# 1180|           found = FALSE;
# 1181|           findcontext = findSimilarSizedTemplatesInit(classer, pix1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def895]
leptonica-1.87.0/src/jbclass.c:1179:14: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1179:14: throw: if ‘pixaGetCount’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1179:14: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/64/codeFlows/0/threadFlows/0/locations/8)
# 1177|           area1 = pixcts[i];
# 1178|           ptaGetPt(pta, i, &x1, &y1);  /* centroid for this instance */
# 1179|->         nt = pixaGetCount(pixat);
# 1180|           found = FALSE;
# 1181|           findcontext = findSimilarSizedTemplatesInit(classer, pix1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def896]
leptonica-1.87.0/src/jbclass.c:1272:23: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1272:23: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1272:23: throw: if ‘pixaGetCount’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1272:23: danger: ‘pixcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/65/codeFlows/0/threadFlows/0/locations/8)
# 1270|           }
# 1271|       }
# 1272|->     classer->nclass = pixaGetCount(pixat);
# 1273|   
# 1274|       LEPT_FREE(pixcts);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def897]
leptonica-1.87.0/src/jbclass.c:1272:23: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1272:23: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1272:23: throw: if ‘pixaGetCount’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1272:23: danger: ‘pixrowcts’ leaks here; was allocated at [(9)](sarif:/runs/0/results/66/codeFlows/0/threadFlows/0/locations/8)
# 1270|           }
# 1271|       }
# 1272|->     classer->nclass = pixaGetCount(pixat);
# 1273|   
# 1274|       LEPT_FREE(pixcts);

Error: CPPCHECK_WARNING (CWE-476): [#def898]
leptonica-1.87.0/src/jbclass.c:1776: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1774|   
# 1775|       classer = (JBCLASSER *)LEPT_CALLOC(1, sizeof(JBCLASSER));
# 1776|->     classer->method = method;
# 1777|       classer->components = components;
# 1778|       classer->nacomps = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def899]
leptonica-1.87.0/src/jbclass.c:1776:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: this call could return NULL
leptonica-1.87.0/src/jbclass.c:1776:5: danger: ‘classer’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/67/codeFlows/0/threadFlows/0/locations/2)
# 1774|   
# 1775|       classer = (JBCLASSER *)LEPT_CALLOC(1, sizeof(JBCLASSER));
# 1776|->     classer->method = method;
# 1777|       classer->components = components;
# 1778|       classer->nacomps = numaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def900]
leptonica-1.87.0/src/jbclass.c:1777: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1775|       classer = (JBCLASSER *)LEPT_CALLOC(1, sizeof(JBCLASSER));
# 1776|       classer->method = method;
# 1777|->     classer->components = components;
# 1778|       classer->nacomps = numaCreate(0);
# 1779|       classer->pixaa = pixaaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def901]
leptonica-1.87.0/src/jbclass.c:1778: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1776|       classer->method = method;
# 1777|       classer->components = components;
# 1778|->     classer->nacomps = numaCreate(0);
# 1779|       classer->pixaa = pixaaCreate(0);
# 1780|       classer->pixat = pixaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def902]
leptonica-1.87.0/src/jbclass.c:1778:24: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1778:24: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1778:24: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/68/codeFlows/0/threadFlows/0/locations/2)
# 1776|       classer->method = method;
# 1777|       classer->components = components;
# 1778|->     classer->nacomps = numaCreate(0);
# 1779|       classer->pixaa = pixaaCreate(0);
# 1780|       classer->pixat = pixaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def903]
leptonica-1.87.0/src/jbclass.c:1779: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1777|       classer->components = components;
# 1778|       classer->nacomps = numaCreate(0);
# 1779|->     classer->pixaa = pixaaCreate(0);
# 1780|       classer->pixat = pixaCreate(0);
# 1781|       classer->pixatd = pixaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def904]
leptonica-1.87.0/src/jbclass.c:1779:22: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1779:22: throw: if ‘pixaaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1779:22: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/69/codeFlows/0/threadFlows/0/locations/2)
# 1777|       classer->components = components;
# 1778|       classer->nacomps = numaCreate(0);
# 1779|->     classer->pixaa = pixaaCreate(0);
# 1780|       classer->pixat = pixaCreate(0);
# 1781|       classer->pixatd = pixaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def905]
leptonica-1.87.0/src/jbclass.c:1780: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1778|       classer->nacomps = numaCreate(0);
# 1779|       classer->pixaa = pixaaCreate(0);
# 1780|->     classer->pixat = pixaCreate(0);
# 1781|       classer->pixatd = pixaCreate(0);
# 1782|       classer->nafgt = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def906]
leptonica-1.87.0/src/jbclass.c:1780:22: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1780:22: throw: if ‘pixaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1780:22: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/70/codeFlows/0/threadFlows/0/locations/2)
# 1778|       classer->nacomps = numaCreate(0);
# 1779|       classer->pixaa = pixaaCreate(0);
# 1780|->     classer->pixat = pixaCreate(0);
# 1781|       classer->pixatd = pixaCreate(0);
# 1782|       classer->nafgt = numaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def907]
leptonica-1.87.0/src/jbclass.c:1781: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1779|       classer->pixaa = pixaaCreate(0);
# 1780|       classer->pixat = pixaCreate(0);
# 1781|->     classer->pixatd = pixaCreate(0);
# 1782|       classer->nafgt = numaCreate(0);
# 1783|       classer->naarea = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def908]
leptonica-1.87.0/src/jbclass.c:1781:23: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1781:23: throw: if ‘pixaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1781:23: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/71/codeFlows/0/threadFlows/0/locations/2)
# 1779|       classer->pixaa = pixaaCreate(0);
# 1780|       classer->pixat = pixaCreate(0);
# 1781|->     classer->pixatd = pixaCreate(0);
# 1782|       classer->nafgt = numaCreate(0);
# 1783|       classer->naarea = numaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def909]
leptonica-1.87.0/src/jbclass.c:1782: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1780|       classer->pixat = pixaCreate(0);
# 1781|       classer->pixatd = pixaCreate(0);
# 1782|->     classer->nafgt = numaCreate(0);
# 1783|       classer->naarea = numaCreate(0);
# 1784|       classer->ptac = ptaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def910]
leptonica-1.87.0/src/jbclass.c:1782:22: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1782:22: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1782:22: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/72/codeFlows/0/threadFlows/0/locations/2)
# 1780|       classer->pixat = pixaCreate(0);
# 1781|       classer->pixatd = pixaCreate(0);
# 1782|->     classer->nafgt = numaCreate(0);
# 1783|       classer->naarea = numaCreate(0);
# 1784|       classer->ptac = ptaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def911]
leptonica-1.87.0/src/jbclass.c:1783: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1781|       classer->pixatd = pixaCreate(0);
# 1782|       classer->nafgt = numaCreate(0);
# 1783|->     classer->naarea = numaCreate(0);
# 1784|       classer->ptac = ptaCreate(0);
# 1785|       classer->ptact = ptaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def912]
leptonica-1.87.0/src/jbclass.c:1783:23: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1783:23: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1783:23: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/73/codeFlows/0/threadFlows/0/locations/2)
# 1781|       classer->pixatd = pixaCreate(0);
# 1782|       classer->nafgt = numaCreate(0);
# 1783|->     classer->naarea = numaCreate(0);
# 1784|       classer->ptac = ptaCreate(0);
# 1785|       classer->ptact = ptaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def913]
leptonica-1.87.0/src/jbclass.c:1784: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1782|       classer->nafgt = numaCreate(0);
# 1783|       classer->naarea = numaCreate(0);
# 1784|->     classer->ptac = ptaCreate(0);
# 1785|       classer->ptact = ptaCreate(0);
# 1786|       classer->naclass = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def914]
leptonica-1.87.0/src/jbclass.c:1784:21: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1784:21: throw: if ‘ptaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1784:21: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/74/codeFlows/0/threadFlows/0/locations/2)
# 1782|       classer->nafgt = numaCreate(0);
# 1783|       classer->naarea = numaCreate(0);
# 1784|->     classer->ptac = ptaCreate(0);
# 1785|       classer->ptact = ptaCreate(0);
# 1786|       classer->naclass = numaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def915]
leptonica-1.87.0/src/jbclass.c:1785: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1783|       classer->naarea = numaCreate(0);
# 1784|       classer->ptac = ptaCreate(0);
# 1785|->     classer->ptact = ptaCreate(0);
# 1786|       classer->naclass = numaCreate(0);
# 1787|       classer->napage = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def916]
leptonica-1.87.0/src/jbclass.c:1785:22: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1785:22: throw: if ‘ptaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1785:22: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/75/codeFlows/0/threadFlows/0/locations/2)
# 1783|       classer->naarea = numaCreate(0);
# 1784|       classer->ptac = ptaCreate(0);
# 1785|->     classer->ptact = ptaCreate(0);
# 1786|       classer->naclass = numaCreate(0);
# 1787|       classer->napage = numaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def917]
leptonica-1.87.0/src/jbclass.c:1786: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1784|       classer->ptac = ptaCreate(0);
# 1785|       classer->ptact = ptaCreate(0);
# 1786|->     classer->naclass = numaCreate(0);
# 1787|       classer->napage = numaCreate(0);
# 1788|       classer->ptaul = ptaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def918]
leptonica-1.87.0/src/jbclass.c:1786:24: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1786:24: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1786:24: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/76/codeFlows/0/threadFlows/0/locations/2)
# 1784|       classer->ptac = ptaCreate(0);
# 1785|       classer->ptact = ptaCreate(0);
# 1786|->     classer->naclass = numaCreate(0);
# 1787|       classer->napage = numaCreate(0);
# 1788|       classer->ptaul = ptaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def919]
leptonica-1.87.0/src/jbclass.c:1787: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1785|       classer->ptact = ptaCreate(0);
# 1786|       classer->naclass = numaCreate(0);
# 1787|->     classer->napage = numaCreate(0);
# 1788|       classer->ptaul = ptaCreate(0);
# 1789|       return classer;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def920]
leptonica-1.87.0/src/jbclass.c:1787:23: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1787:23: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1787:23: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/77/codeFlows/0/threadFlows/0/locations/2)
# 1785|       classer->ptact = ptaCreate(0);
# 1786|       classer->naclass = numaCreate(0);
# 1787|->     classer->napage = numaCreate(0);
# 1788|       classer->ptaul = ptaCreate(0);
# 1789|       return classer;

Error: CPPCHECK_WARNING (CWE-476): [#def921]
leptonica-1.87.0/src/jbclass.c:1788: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: classer
# 1786|       classer->naclass = numaCreate(0);
# 1787|       classer->napage = numaCreate(0);
# 1788|->     classer->ptaul = ptaCreate(0);
# 1789|       return classer;
# 1790|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def922]
leptonica-1.87.0/src/jbclass.c:1788:22: warning[-Wanalyzer-malloc-leak]: leak of ‘classer’
leptonica-1.87.0/src/jbclass.c:1771:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1775:28: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1775:28: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1788:22: throw: if ‘ptaCreate’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1788:22: danger: ‘classer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/78/codeFlows/0/threadFlows/0/locations/2)
# 1786|       classer->naclass = numaCreate(0);
# 1787|       classer->napage = numaCreate(0);
# 1788|->     classer->ptaul = ptaCreate(0);
# 1789|       return classer;
# 1790|   }

Error: CPPCHECK_WARNING (CWE-476): [#def923]
leptonica-1.87.0/src/jbclass.c:1866: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1864|   
# 1865|       data = (JBDATA *)LEPT_CALLOC(1, sizeof(JBDATA));
# 1866|->     data->pix = pix;
# 1867|       data->npages = classer->npages;
# 1868|       data->w = classer->w;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def924]
leptonica-1.87.0/src/jbclass.c:1866:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘data’
leptonica-1.87.0/src/jbclass.c:1855:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1859:19: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1862:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1865:22: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1865:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/jbclass.c:1866:5: danger: ‘data’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/79/codeFlows/0/threadFlows/0/locations/4)
# 1864|   
# 1865|       data = (JBDATA *)LEPT_CALLOC(1, sizeof(JBDATA));
# 1866|->     data->pix = pix;
# 1867|       data->npages = classer->npages;
# 1868|       data->w = classer->w;

Error: CPPCHECK_WARNING (CWE-476): [#def925]
leptonica-1.87.0/src/jbclass.c:1867: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1865|       data = (JBDATA *)LEPT_CALLOC(1, sizeof(JBDATA));
# 1866|       data->pix = pix;
# 1867|->     data->npages = classer->npages;
# 1868|       data->w = classer->w;
# 1869|       data->h = classer->h;

Error: CPPCHECK_WARNING (CWE-476): [#def926]
leptonica-1.87.0/src/jbclass.c:1868: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1866|       data->pix = pix;
# 1867|       data->npages = classer->npages;
# 1868|->     data->w = classer->w;
# 1869|       data->h = classer->h;
# 1870|       data->nclass = classer->nclass;

Error: CPPCHECK_WARNING (CWE-476): [#def927]
leptonica-1.87.0/src/jbclass.c:1869: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1867|       data->npages = classer->npages;
# 1868|       data->w = classer->w;
# 1869|->     data->h = classer->h;
# 1870|       data->nclass = classer->nclass;
# 1871|       data->latticew = maxw + 1;

Error: CPPCHECK_WARNING (CWE-476): [#def928]
leptonica-1.87.0/src/jbclass.c:1870: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1868|       data->w = classer->w;
# 1869|       data->h = classer->h;
# 1870|->     data->nclass = classer->nclass;
# 1871|       data->latticew = maxw + 1;
# 1872|       data->latticeh = maxh + 1;

Error: CPPCHECK_WARNING (CWE-476): [#def929]
leptonica-1.87.0/src/jbclass.c:1871: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1869|       data->h = classer->h;
# 1870|       data->nclass = classer->nclass;
# 1871|->     data->latticew = maxw + 1;
# 1872|       data->latticeh = maxh + 1;
# 1873|       data->naclass = numaClone(classer->naclass);

Error: CPPCHECK_WARNING (CWE-476): [#def930]
leptonica-1.87.0/src/jbclass.c:1872: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1870|       data->nclass = classer->nclass;
# 1871|       data->latticew = maxw + 1;
# 1872|->     data->latticeh = maxh + 1;
# 1873|       data->naclass = numaClone(classer->naclass);
# 1874|       data->napage = numaClone(classer->napage);

Error: CPPCHECK_WARNING (CWE-476): [#def931]
leptonica-1.87.0/src/jbclass.c:1873: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1871|       data->latticew = maxw + 1;
# 1872|       data->latticeh = maxh + 1;
# 1873|->     data->naclass = numaClone(classer->naclass);
# 1874|       data->napage = numaClone(classer->napage);
# 1875|       data->ptaul = ptaClone(classer->ptaul);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def932]
leptonica-1.87.0/src/jbclass.c:1873:21: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/jbclass.c:1855:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1859:19: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1862:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1865:22: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1865:22: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1873:21: throw: if ‘numaClone’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1873:21: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/80/codeFlows/0/threadFlows/0/locations/4)
# 1871|       data->latticew = maxw + 1;
# 1872|       data->latticeh = maxh + 1;
# 1873|->     data->naclass = numaClone(classer->naclass);
# 1874|       data->napage = numaClone(classer->napage);
# 1875|       data->ptaul = ptaClone(classer->ptaul);

Error: CPPCHECK_WARNING (CWE-476): [#def933]
leptonica-1.87.0/src/jbclass.c:1874: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1872|       data->latticeh = maxh + 1;
# 1873|       data->naclass = numaClone(classer->naclass);
# 1874|->     data->napage = numaClone(classer->napage);
# 1875|       data->ptaul = ptaClone(classer->ptaul);
# 1876|       return data;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def934]
leptonica-1.87.0/src/jbclass.c:1874:20: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/jbclass.c:1855:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1859:19: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1862:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1865:22: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1865:22: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1874:20: throw: if ‘numaClone’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1874:20: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/81/codeFlows/0/threadFlows/0/locations/4)
# 1872|       data->latticeh = maxh + 1;
# 1873|       data->naclass = numaClone(classer->naclass);
# 1874|->     data->napage = numaClone(classer->napage);
# 1875|       data->ptaul = ptaClone(classer->ptaul);
# 1876|       return data;

Error: CPPCHECK_WARNING (CWE-476): [#def935]
leptonica-1.87.0/src/jbclass.c:1875: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1873|       data->naclass = numaClone(classer->naclass);
# 1874|       data->napage = numaClone(classer->napage);
# 1875|->     data->ptaul = ptaClone(classer->ptaul);
# 1876|       return data;
# 1877|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def936]
leptonica-1.87.0/src/jbclass.c:1875:19: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/jbclass.c:1855:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1859:19: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1862:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1865:22: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1865:22: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1875:19: throw: if ‘ptaClone’ throws an exception...
leptonica-1.87.0/src/jbclass.c:1875:19: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/82/codeFlows/0/threadFlows/0/locations/4)
# 1873|       data->naclass = numaClone(classer->naclass);
# 1874|       data->napage = numaClone(classer->napage);
# 1875|->     data->ptaul = ptaClone(classer->ptaul);
# 1876|       return data;
# 1877|   }

Error: CPPCHECK_WARNING (CWE-476): [#def937]
leptonica-1.87.0/src/jbclass.c:2052: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: jbdata
# 2050|   
# 2051|       jbdata = (JBDATA *)LEPT_CALLOC(1, sizeof(JBDATA));
# 2052|->     jbdata->pix = pixs;
# 2053|       jbdata->npages = npages;
# 2054|       jbdata->w = w;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def938]
leptonica-1.87.0/src/jbclass.c:2052:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘jbdata’
leptonica-1.87.0/src/jbclass.c:1990:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1993:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1994:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1997:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1998:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:2003:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:2003:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:2008:11: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:2010:8: branch_false: following ‘false’ branch (when the strings are equal)...
leptonica-1.87.0/src/jbclass.c:2016:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:2051:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/jbclass.c:2052:5: danger: ‘jbdata’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/83/codeFlows/0/threadFlows/0/locations/10)
# 2050|   
# 2051|       jbdata = (JBDATA *)LEPT_CALLOC(1, sizeof(JBDATA));
# 2052|->     jbdata->pix = pixs;
# 2053|       jbdata->npages = npages;
# 2054|       jbdata->w = w;

Error: CPPCHECK_WARNING (CWE-476): [#def939]
leptonica-1.87.0/src/jbclass.c:2053: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: jbdata
# 2051|       jbdata = (JBDATA *)LEPT_CALLOC(1, sizeof(JBDATA));
# 2052|       jbdata->pix = pixs;
# 2053|->     jbdata->npages = npages;
# 2054|       jbdata->w = w;
# 2055|       jbdata->h = h;

Error: CPPCHECK_WARNING (CWE-476): [#def940]
leptonica-1.87.0/src/jbclass.c:2054: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: jbdata
# 2052|       jbdata->pix = pixs;
# 2053|       jbdata->npages = npages;
# 2054|->     jbdata->w = w;
# 2055|       jbdata->h = h;
# 2056|       jbdata->nclass = nclass;

Error: CPPCHECK_WARNING (CWE-476): [#def941]
leptonica-1.87.0/src/jbclass.c:2055: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: jbdata
# 2053|       jbdata->npages = npages;
# 2054|       jbdata->w = w;
# 2055|->     jbdata->h = h;
# 2056|       jbdata->nclass = nclass;
# 2057|       jbdata->latticew = cellw;

Error: CPPCHECK_WARNING (CWE-476): [#def942]
leptonica-1.87.0/src/jbclass.c:2056: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: jbdata
# 2054|       jbdata->w = w;
# 2055|       jbdata->h = h;
# 2056|->     jbdata->nclass = nclass;
# 2057|       jbdata->latticew = cellw;
# 2058|       jbdata->latticeh = cellh;

Error: CPPCHECK_WARNING (CWE-476): [#def943]
leptonica-1.87.0/src/jbclass.c:2057: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: jbdata
# 2055|       jbdata->h = h;
# 2056|       jbdata->nclass = nclass;
# 2057|->     jbdata->latticew = cellw;
# 2058|       jbdata->latticeh = cellh;
# 2059|       jbdata->naclass = naclass;

Error: CPPCHECK_WARNING (CWE-476): [#def944]
leptonica-1.87.0/src/jbclass.c:2058: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: jbdata
# 2056|       jbdata->nclass = nclass;
# 2057|       jbdata->latticew = cellw;
# 2058|->     jbdata->latticeh = cellh;
# 2059|       jbdata->naclass = naclass;
# 2060|       jbdata->napage = napage;

Error: CPPCHECK_WARNING (CWE-476): [#def945]
leptonica-1.87.0/src/jbclass.c:2059: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: jbdata
# 2057|       jbdata->latticew = cellw;
# 2058|       jbdata->latticeh = cellh;
# 2059|->     jbdata->naclass = naclass;
# 2060|       jbdata->napage = napage;
# 2061|       jbdata->ptaul = ptaul;

Error: CPPCHECK_WARNING (CWE-476): [#def946]
leptonica-1.87.0/src/jbclass.c:2060: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: jbdata
# 2058|       jbdata->latticeh = cellh;
# 2059|       jbdata->naclass = naclass;
# 2060|->     jbdata->napage = napage;
# 2061|       jbdata->ptaul = ptaul;
# 2062|   

Error: CPPCHECK_WARNING (CWE-476): [#def947]
leptonica-1.87.0/src/jbclass.c:2061: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: jbdata
# 2059|       jbdata->naclass = naclass;
# 2060|       jbdata->napage = napage;
# 2061|->     jbdata->ptaul = ptaul;
# 2062|   
# 2063|       LEPT_FREE(data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def948]
leptonica-1.87.0/src/jbclass.c:2064:5: warning[-Wanalyzer-malloc-leak]: leak of ‘jbdata’
leptonica-1.87.0/src/jbclass.c:1990:8: branch_false: following ‘false’ branch (when ‘rootname’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1993:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1994:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1997:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1998:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:2003:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:2003:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:2008:11: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:2010:8: branch_false: following ‘false’ branch (when the strings are equal)...
leptonica-1.87.0/src/jbclass.c:2016:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:2051:24: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:2064:5: throw: if ‘sarrayDestroy’ throws an exception...
leptonica-1.87.0/src/jbclass.c:2064:5: danger: ‘jbdata’ leaks here; was allocated at [(11)](sarif:/runs/0/results/84/codeFlows/0/threadFlows/0/locations/10)
# 2062|   
# 2063|       LEPT_FREE(data);
# 2064|->     sarrayDestroy(&sa);
# 2065|       return jbdata;
# 2066|   }

Error: COMPILER_WARNING (CWE-457): [#def949]
leptonica-1.87.0/src/jbclass.c: scope_hint: In function ‘jbGetULCorners’
leptonica-1.87.0/src/jbclass.c:2272:35: warning[-Wmaybe-uninitialized]: ‘dx’ may be used uninitialized
# 2272 |         ptaAddPt(ptaul, x - idelx + dx, y - idely + dy);
#      |                         ~~~~~~~~~~^~~~
leptonica-1.87.0/src/jbclass.c:2223:64: note: ‘dx’ was declared here
# 2223 | l_int32    i, baseindex, index, n, iclass, idelx, idely, x, y, dx, dy;
#      |                                                                ^~
# 2270|   /*        if (i % 20 == 0)
# 2271|               lept_stderr("dx = %d, dy = %d\n", dx, dy); */
# 2272|->         ptaAddPt(ptaul, x - idelx + dx, y - idely + dy);
# 2273|           boxDestroy(&box);
# 2274|           pixDestroy(&pixt);

Error: COMPILER_WARNING (CWE-457): [#def950]
leptonica-1.87.0/src/jbclass.c:2272:51: warning[-Wmaybe-uninitialized]: ‘dy’ may be used uninitialized
# 2272 |         ptaAddPt(ptaul, x - idelx + dx, y - idely + dy);
#      |                                         ~~~~~~~~~~^~~~
leptonica-1.87.0/src/jbclass.c:2223:68: note: ‘dy’ was declared here
# 2223 | l_int32    i, baseindex, index, n, iclass, idelx, idely, x, y, dx, dy;
#      |                                                                    ^~
# 2270|   /*        if (i % 20 == 0)
# 2271|               lept_stderr("dx = %d, dy = %d\n", dx, dy); */
# 2272|->         ptaAddPt(ptaul, x - idelx + dx, y - idely + dy);
# 2273|           boxDestroy(&box);
# 2274|           pixDestroy(&pixt);

Error: CPPCHECK_WARNING (CWE-476): [#def951]
leptonica-1.87.0/src/jbclass.c:2396: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
# 2394|   
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|->     state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|       state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def952]
leptonica-1.87.0/src/jbclass.c:2396:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘state’
leptonica-1.87.0/src/jbclass.c:2395:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/jbclass.c:2396:5: danger: ‘state’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/85/codeFlows/0/threadFlows/0/locations/0)
# 2394|   
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|->     state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|       state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def953]
leptonica-1.87.0/src/jbclass.c:2396:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1181:23: call_function: calling ‘findSimilarSizedTemplatesInit’ from ‘jbClassifyCorrelation’
# 2394|   
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|->     state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|       state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def954]
leptonica-1.87.0/src/jbclass.c:2396:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1181:23: call_function: calling ‘findSimilarSizedTemplatesInit’ from ‘jbClassifyCorrelation’
# 2394|   
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|->     state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|       state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def955]
leptonica-1.87.0/src/jbclass.c:2396:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1181:23: call_function: calling ‘findSimilarSizedTemplatesInit’ from ‘jbClassifyCorrelation’
# 2394|   
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|->     state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|       state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def956]
leptonica-1.87.0/src/jbclass.c:2396:16: warning[-Wanalyzer-malloc-leak]: leak of ‘state’
leptonica-1.87.0/src/jbclass.c:2395:26: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:2396:16: throw: if ‘pixGetWidth’ throws an exception...
leptonica-1.87.0/src/jbclass.c:2396:16: danger: ‘state’ leaks here; was allocated at [(1)](sarif:/runs/0/results/86/codeFlows/0/threadFlows/0/locations/0)
# 2394|   
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|->     state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|       state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;

Error: CPPCHECK_WARNING (CWE-476): [#def957]
leptonica-1.87.0/src/jbclass.c:2397: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|       state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|->     state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;
# 2399|       return state;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def958]
leptonica-1.87.0/src/jbclass.c:2397:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1094:35: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1181:23: call_function: calling ‘findSimilarSizedTemplatesInit’ from ‘jbClassifyCorrelation’
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|       state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|->     state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;
# 2399|       return state;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def959]
leptonica-1.87.0/src/jbclass.c:2397:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1181:23: call_function: calling ‘findSimilarSizedTemplatesInit’ from ‘jbClassifyCorrelation’
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|       state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|->     state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;
# 2399|       return state;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def960]
leptonica-1.87.0/src/jbclass.c:2397:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_false: following ‘false’ branch (when ‘y < 0’)...
leptonica-1.87.0/src/jbclass.c:1122:15: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1181:23: call_function: calling ‘findSimilarSizedTemplatesInit’ from ‘jbClassifyCorrelation’
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|       state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|->     state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;
# 2399|       return state;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def961]
leptonica-1.87.0/src/jbclass.c:2397:16: warning[-Wanalyzer-malloc-leak]: leak of ‘state’
leptonica-1.87.0/src/jbclass.c:2395:26: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:2397:16: throw: if ‘pixGetHeight’ throws an exception...
leptonica-1.87.0/src/jbclass.c:2397:16: danger: ‘state’ leaks here; was allocated at [(1)](sarif:/runs/0/results/90/codeFlows/0/threadFlows/0/locations/0)
# 2395|       state = (JBFINDCTX *)LEPT_CALLOC(1, sizeof(JBFINDCTX));
# 2396|       state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|->     state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|       state->classer = classer;
# 2399|       return state;

Error: CPPCHECK_WARNING (CWE-476): [#def962]
leptonica-1.87.0/src/jbclass.c:2398: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
# 2396|       state->w = pixGetWidth(pixs) - 2 * JB_ADDED_PIXELS;
# 2397|       state->h = pixGetHeight(pixs) - 2 * JB_ADDED_PIXELS;
# 2398|->     state->classer = classer;
# 2399|       return state;
# 2400|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def963]
leptonica-1.87.0/src/jbclass.c:2459:26: warning[-Wanalyzer-malloc-leak]: leak of ‘findcontext’
leptonica-1.87.0/src/jbclass.c:585:1: enter_function: entry to ‘jbClassifyRankHaus’
leptonica-1.87.0/src/jbclass.c:605:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:607:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:607:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:609:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:609:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:611:14: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:613:17: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:613:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:616:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:684:8: branch_true: following ‘true’ branch (when ‘rank == 1.0e+0f’)...
leptonica-1.87.0/src/jbclass.c:684:8: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:685:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:686:20: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:691:27: call_function: calling ‘findSimilarSizedTemplatesInit’ from ‘jbClassifyRankHaus’
leptonica-1.87.0/src/jbclass.c:691:27: return_function: returning to ‘jbClassifyRankHaus’ from ‘findSimilarSizedTemplatesInit’
leptonica-1.87.0/src/jbclass.c:692:30: call_function: calling ‘findSimilarSizedTemplatesNext’ from ‘jbClassifyRankHaus’
# 2457|           if (!state->dna) {
# 2458|                   /* We have yet to start walking the array for the step 'i' */
# 2459|->             state->dna = l_dnaHashGetDna(state->classer->dahash,
# 2460|                                 (l_uint64)desiredh * desiredw, L_CLONE);
# 2461|               if (!state->dna) {  /* nothing there */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def964]
leptonica-1.87.0/src/jbclass.c:2459:26: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1182:27: call_function: calling ‘findSimilarSizedTemplatesNext’ from ‘jbClassifyCorrelation’
# 2457|           if (!state->dna) {
# 2458|                   /* We have yet to start walking the array for the step 'i' */
# 2459|->             state->dna = l_dnaHashGetDna(state->classer->dahash,
# 2460|                                 (l_uint64)desiredh * desiredw, L_CLONE);
# 2461|               if (!state->dna) {  /* nothing there */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def965]
leptonica-1.87.0/src/jbclass.c:2459:26: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1182:27: call_function: calling ‘findSimilarSizedTemplatesNext’ from ‘jbClassifyCorrelation’
# 2457|           if (!state->dna) {
# 2458|                   /* We have yet to start walking the array for the step 'i' */
# 2459|->             state->dna = l_dnaHashGetDna(state->classer->dahash,
# 2460|                                 (l_uint64)desiredh * desiredw, L_CLONE);
# 2461|               if (!state->dna) {  /* nothing there */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def966]
leptonica-1.87.0/src/jbclass.c:2470:16: warning[-Wanalyzer-malloc-leak]: leak of ‘findcontext’
leptonica-1.87.0/src/jbclass.c:585:1: enter_function: entry to ‘jbClassifyRankHaus’
leptonica-1.87.0/src/jbclass.c:605:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:607:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:607:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:609:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:609:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:611:14: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:613:17: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:613:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:616:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:684:8: branch_true: following ‘true’ branch (when ‘rank == 1.0e+0f’)...
leptonica-1.87.0/src/jbclass.c:684:8: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:685:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:686:20: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:691:27: call_function: calling ‘findSimilarSizedTemplatesInit’ from ‘jbClassifyRankHaus’
leptonica-1.87.0/src/jbclass.c:691:27: return_function: returning to ‘jbClassifyRankHaus’ from ‘findSimilarSizedTemplatesInit’
leptonica-1.87.0/src/jbclass.c:692:30: call_function: calling ‘findSimilarSizedTemplatesNext’ from ‘jbClassifyRankHaus’
# 2468|   
# 2469|               /* Continue working on this dna */
# 2470|->         size = l_dnaGetCount(state->dna);
# 2471|           for ( ; state->n < size; ) {
# 2472|               templ = (l_int32)(state->dna->array[state->n++] + 0.5);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def967]
leptonica-1.87.0/src/jbclass.c:2470:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1182:27: call_function: calling ‘findSimilarSizedTemplatesNext’ from ‘jbClassifyCorrelation’
# 2468|   
# 2469|               /* Continue working on this dna */
# 2470|->         size = l_dnaGetCount(state->dna);
# 2471|           for ( ; state->n < size; ) {
# 2472|               templ = (l_int32)(state->dna->array[state->n++] + 0.5);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def968]
leptonica-1.87.0/src/jbclass.c:2470:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1182:27: call_function: calling ‘findSimilarSizedTemplatesNext’ from ‘jbClassifyCorrelation’
# 2468|   
# 2469|               /* Continue working on this dna */
# 2470|->         size = l_dnaGetCount(state->dna);
# 2471|           for ( ; state->n < size; ) {
# 2472|               templ = (l_int32)(state->dna->array[state->n++] + 0.5);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def969]
leptonica-1.87.0/src/jbclass.c:2485:9: warning[-Wanalyzer-malloc-leak]: leak of ‘findcontext’
leptonica-1.87.0/src/jbclass.c:585:1: enter_function: entry to ‘jbClassifyRankHaus’
leptonica-1.87.0/src/jbclass.c:605:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:607:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:607:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:609:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:609:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:611:14: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:613:17: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:613:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:616:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:684:8: branch_true: following ‘true’ branch (when ‘rank == 1.0e+0f’)...
leptonica-1.87.0/src/jbclass.c:684:8: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:685:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:686:20: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:691:27: call_function: calling ‘findSimilarSizedTemplatesInit’ from ‘jbClassifyRankHaus’
leptonica-1.87.0/src/jbclass.c:691:27: return_function: returning to ‘jbClassifyRankHaus’ from ‘findSimilarSizedTemplatesInit’
leptonica-1.87.0/src/jbclass.c:692:30: call_function: calling ‘findSimilarSizedTemplatesNext’ from ‘jbClassifyRankHaus’
# 2483|                * try again. */
# 2484|           state->i++;
# 2485|->         l_dnaDestroy(&state->dna);
# 2486|           continue;
# 2487|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def970]
leptonica-1.87.0/src/jbclass.c:2485:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixcts’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1080:25: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1182:27: call_function: calling ‘findSimilarSizedTemplatesNext’ from ‘jbClassifyCorrelation’
# 2483|                * try again. */
# 2484|           state->i++;
# 2485|->         l_dnaDestroy(&state->dna);
# 2486|           continue;
# 2487|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def971]
leptonica-1.87.0/src/jbclass.c:2485:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixrowcts’
leptonica-1.87.0/src/jbclass.c:1023:1: enter_function: entry to ‘jbClassifyCorrelation’
leptonica-1.87.0/src/jbclass.c:1048:8: branch_false: following ‘false’ branch (when ‘classer’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1050:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1052:8: branch_false: following ‘false’ branch (when ‘pixas’ is non-NULL)...
leptonica-1.87.0/src/jbclass.c:1055:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1059:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1063:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1081:29: acquire_memory: allocated here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1093:15: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1101:41: branch_true: following ‘true’ branch (when ‘y >= 0’)...
leptonica-1.87.0/src/jbclass.c:1102:25: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1104:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1119:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1123:12: branch_false: following ‘false’ branch (when ‘downcount <= 0’)...
leptonica-1.87.0/src/jbclass.c:1127:13: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1092:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jbclass.c:1133:5: branch_false: ...to here
leptonica-1.87.0/src/jbclass.c:1175:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jbclass.c:1176:16: branch_true: ...to here
leptonica-1.87.0/src/jbclass.c:1182:27: call_function: calling ‘findSimilarSizedTemplatesNext’ from ‘jbClassifyCorrelation’
# 2483|                * try again. */
# 2484|           state->i++;
# 2485|->         l_dnaDestroy(&state->dna);
# 2486|           continue;
# 2487|       }

Error: CPPCHECK_WARNING (CWE-457): [#def972]
leptonica-1.87.0/src/jbclass.c:2558: warning[uninitvar]: Uninitialized variable: minx
# 2556|       pixDestroy(&pixr);
# 2557|   
# 2558|->     *pdx = minx;
# 2559|       *pdy = miny;
# 2560|       return 0;

Error: CPPCHECK_WARNING (CWE-457): [#def973]
leptonica-1.87.0/src/jbclass.c:2559: warning[uninitvar]: Uninitialized variable: miny
# 2557|   
# 2558|       *pdx = minx;
# 2559|->     *pdy = miny;
# 2560|       return 0;
# 2561|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def974]
leptonica-1.87.0/src/jpegio.c:337:15: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:336:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:337:15: throw: if ‘pixCreate’ throws an exception...
leptonica-1.87.0/src/jpegio.c:337:15: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#  335|       if ((spp == 3 && cmapflag == 0) || ycck || cmyk) {  /* rgb or 4 bpp color */
#  336|           rowbuffer = (JSAMPROW)LEPT_CALLOC(sizeof(JSAMPLE), (size_t)spp * w);
#  337|->         pix = pixCreate(w, h, 32);
#  338|       } else {  /* 8 bpp gray or colormapped */
#  339|           rowbuffer = (JSAMPROW)LEPT_CALLOC(sizeof(JSAMPLE), w);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def975]
leptonica-1.87.0/src/jpegio.c:340:15: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:335:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:340:15: throw: if ‘pixCreate’ throws an exception...
leptonica-1.87.0/src/jpegio.c:340:15: danger: ‘rowbuffer’ leaks here; was allocated at [(8)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/7)
#  338|       } else {  /* 8 bpp gray or colormapped */
#  339|           rowbuffer = (JSAMPROW)LEPT_CALLOC(sizeof(JSAMPLE), w);
#  340|->         pix = pixCreate(w, h, 8);
#  341|       }
#  342|       if (!rowbuffer || !pix) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def976]
leptonica-1.87.0/src/jpegio.c:349:5: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:336:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:349:5: throw: if ‘pixSetInputFormat’ throws an exception...
leptonica-1.87.0/src/jpegio.c:349:5: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/5)
#  347|           return (PIX *)ERROR_PTR("rowbuffer or pix not made", __func__, NULL);
#  348|       }
#  349|->     pixSetInputFormat(pix, IFF_JFIF_JPEG);
#  350|   
#  351|           /* Initialize decompression.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def977]
leptonica-1.87.0/src/jpegio.c:359:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:358:8: branch_true: following ‘true’ branch (when ‘spp == 1’)...
leptonica-1.87.0/src/jpegio.c:359:9: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:359:9: throw: if ‘jpeg_start_decompress’ throws an exception...
leptonica-1.87.0/src/jpegio.c:359:9: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/5)
#  357|            * there is no way to get a callback from an error in this phase. */
#  358|       if (spp == 1) {  /* Grayscale or colormapped */
#  359|->         jpeg_start_decompress(&cinfo);
#  360|       } else {        /* Color; spp == 3 or YCCK or CMYK */
#  361|           if (cmapflag == 0) {   /* 24 bit color in 32 bit pix or YCCK/CMYK */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def978]
leptonica-1.87.0/src/jpegio.c:363:13: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:336:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:358:8: branch_false: following ‘false’ branch (when ‘spp != 1’)...
leptonica-1.87.0/src/jpegio.c:361:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:361:12: branch_true: following ‘true’ branch (when ‘cmapflag == 0’)...
leptonica-1.87.0/src/jpegio.c:362:13: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:363:13: throw: if ‘jpeg_start_decompress’ throws an exception...
leptonica-1.87.0/src/jpegio.c:363:13: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/5)
#  361|           if (cmapflag == 0) {   /* 24 bit color in 32 bit pix or YCCK/CMYK */
#  362|               cinfo.quantize_colors = FALSE;
#  363|->             jpeg_start_decompress(&cinfo);
#  364|           } else {      /* Color quantize to 8 bits */
#  365|               cinfo.quantize_colors = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def979]
leptonica-1.87.0/src/jpegio.c:367:13: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:358:8: branch_false: following ‘false’ branch (when ‘spp != 1’)...
leptonica-1.87.0/src/jpegio.c:361:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:361:12: branch_false: following ‘false’ branch (when ‘cmapflag != 0’)...
leptonica-1.87.0/src/jpegio.c:365:13: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:367:13: throw: if ‘jpeg_start_decompress’ throws an exception...
leptonica-1.87.0/src/jpegio.c:367:13: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/5)
#  365|               cinfo.quantize_colors = TRUE;
#  366|               cinfo.desired_number_of_colors = 256;
#  367|->             jpeg_start_decompress(&cinfo);
#  368|   
#  369|                   /* Construct a pix cmap */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def980]
leptonica-1.87.0/src/jpegio.c:370:20: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:358:8: branch_false: following ‘false’ branch (when ‘spp != 1’)...
leptonica-1.87.0/src/jpegio.c:361:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:361:12: branch_false: following ‘false’ branch (when ‘cmapflag != 0’)...
leptonica-1.87.0/src/jpegio.c:365:13: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:370:20: throw: if ‘pixcmapCreate’ throws an exception...
leptonica-1.87.0/src/jpegio.c:370:20: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/5)
#  368|   
#  369|                   /* Construct a pix cmap */
#  370|->             cmap = pixcmapCreate(8);
#  371|               ncolors = cinfo.actual_number_of_colors;
#  372|               for (cindex = 0; cindex < ncolors; cindex++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def981]
leptonica-1.87.0/src/jpegio.c:376:17: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:358:8: branch_false: following ‘false’ branch (when ‘spp != 1’)...
leptonica-1.87.0/src/jpegio.c:361:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:361:12: branch_false: following ‘false’ branch (when ‘cmapflag != 0’)...
leptonica-1.87.0/src/jpegio.c:365:13: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:372:30: branch_true: following ‘true’ branch (when ‘cindex < ncolors’)...
leptonica-1.87.0/src/jpegio.c:373:24: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:376:17: throw: if ‘pixcmapAddColor’ throws an exception...
leptonica-1.87.0/src/jpegio.c:376:17: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/5)
#  374|                   gval = cinfo.colormap[1][cindex];
#  375|                   bval = cinfo.colormap[2][cindex];
#  376|->                 pixcmapAddColor(cmap, rval, gval, bval);
#  377|               }
#  378|               pixSetColormap(pix, cmap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def982]
leptonica-1.87.0/src/jpegio.c:378:13: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:358:8: branch_false: following ‘false’ branch (when ‘spp != 1’)...
leptonica-1.87.0/src/jpegio.c:361:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:361:12: branch_false: following ‘false’ branch (when ‘cmapflag != 0’)...
leptonica-1.87.0/src/jpegio.c:365:13: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:378:13: throw: if ‘pixSetColormap’ throws an exception...
leptonica-1.87.0/src/jpegio.c:378:13: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/5)
#  376|                   pixcmapAddColor(cmap, rval, gval, bval);
#  377|               }
#  378|->             pixSetColormap(pix, cmap);
#  379|           }
#  380|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def983]
leptonica-1.87.0/src/jpegio.c:381:12: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:381:12: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/jpegio.c:381:12: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/5)
#  379|           }
#  380|       }
#  381|->     wpl  = pixGetWpl(pix);
#  382|       data = pixGetData(pix);
#  383|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def984]
leptonica-1.87.0/src/jpegio.c:382:12: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:382:12: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/jpegio.c:382:12: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/5)
#  380|       }
#  381|       wpl  = pixGetWpl(pix);
#  382|->     data = pixGetData(pix);
#  383|   
#  384|           /* Decompress.  It appears that jpeg_read_scanlines() always

Error: GCC_ANALYZER_WARNING (CWE-401): [#def985]
leptonica-1.87.0/src/jpegio.c:395:22: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:394:17: branch_true: following ‘true’ branch (when ‘i < h’)...
leptonica-1.87.0/src/jpegio.c:395:22: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:395:22: throw: if ‘jpeg_read_scanlines’ throws an exception...
leptonica-1.87.0/src/jpegio.c:395:22: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/5)
#  393|       abort_on_warning = (hint & L_JPEG_CONTINUE_WITH_BAD_DATA) ? 0 : 1;
#  394|       for (i = 0; i < h; i++) {
#  395|->         nlinesread = jpeg_read_scanlines(&cinfo, &rowbuffer, (JDIMENSION)1);
#  396|           nwarn = cinfo.err->num_warnings;
#  397|           if (nlinesread == 0 || (abort_on_warning && nwarn > 0)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def986]
leptonica-1.87.0/src/jpegio.c:471:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:394:17: branch_false: following ‘false’ branch (when ‘i >= h’)...
leptonica-1.87.0/src/jpegio.c:470:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:470:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jpegio.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:471:9: throw: if ‘pixSetXRes’ throws an exception...
leptonica-1.87.0/src/jpegio.c:471:9: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/5)
#  469|            * In that case, don't set the resolution.  */
#  470|       if (cinfo.density_unit == 1) {  /* pixels per inch */
#  471|->         pixSetXRes(pix, cinfo.X_density);
#  472|           pixSetYRes(pix, cinfo.Y_density);
#  473|       } else if (cinfo.density_unit == 2) {  /* pixels per centimeter */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def987]
leptonica-1.87.0/src/jpegio.c:472:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:394:17: branch_false: following ‘false’ branch (when ‘i >= h’)...
leptonica-1.87.0/src/jpegio.c:470:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:470:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jpegio.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:472:9: throw: if ‘pixSetYRes’ throws an exception...
leptonica-1.87.0/src/jpegio.c:472:9: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/5)
#  470|       if (cinfo.density_unit == 1) {  /* pixels per inch */
#  471|           pixSetXRes(pix, cinfo.X_density);
#  472|->         pixSetYRes(pix, cinfo.Y_density);
#  473|       } else if (cinfo.density_unit == 2) {  /* pixels per centimeter */
#  474|           pixSetXRes(pix, (l_int32)((l_float32)cinfo.X_density * 2.54 + 0.5));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def988]
leptonica-1.87.0/src/jpegio.c:474:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:394:17: branch_false: following ‘false’ branch (when ‘i >= h’)...
leptonica-1.87.0/src/jpegio.c:470:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:470:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:473:15: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:473:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jpegio.c:474:46: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:474:9: throw: if ‘pixSetXRes’ throws an exception...
leptonica-1.87.0/src/jpegio.c:474:9: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/5)
#  472|           pixSetYRes(pix, cinfo.Y_density);
#  473|       } else if (cinfo.density_unit == 2) {  /* pixels per centimeter */
#  474|->         pixSetXRes(pix, (l_int32)((l_float32)cinfo.X_density * 2.54 + 0.5));
#  475|           pixSetYRes(pix, (l_int32)((l_float32)cinfo.Y_density * 2.54 + 0.5));
#  476|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def989]
leptonica-1.87.0/src/jpegio.c:475:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:394:17: branch_false: following ‘false’ branch (when ‘i >= h’)...
leptonica-1.87.0/src/jpegio.c:470:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:470:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:473:15: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:473:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jpegio.c:474:46: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:475:9: throw: if ‘pixSetYRes’ throws an exception...
leptonica-1.87.0/src/jpegio.c:475:9: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/5)
#  473|       } else if (cinfo.density_unit == 2) {  /* pixels per centimeter */
#  474|           pixSetXRes(pix, (l_int32)((l_float32)cinfo.X_density * 2.54 + 0.5));
#  475|->         pixSetYRes(pix, (l_int32)((l_float32)cinfo.Y_density * 2.54 + 0.5));
#  476|       }
#  477|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def990]
leptonica-1.87.0/src/jpegio.c:479:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:394:17: branch_false: following ‘false’ branch (when ‘i >= h’)...
leptonica-1.87.0/src/jpegio.c:470:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:478:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jpegio.c:479:9: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:479:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/jpegio.c:479:9: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/5)
#  477|   
#  478|       if (cinfo.output_components != spp)
#  479|->         lept_stderr("output spp = %d, spp = %d\n",
#  480|                       cinfo.output_components, spp);
#  481|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def991]
leptonica-1.87.0/src/jpegio.c:482:5: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:394:17: branch_false: following ‘false’ branch (when ‘i >= h’)...
leptonica-1.87.0/src/jpegio.c:470:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:482:5: throw: if ‘jpeg_finish_decompress’ throws an exception...
leptonica-1.87.0/src/jpegio.c:482:5: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/5)
#  480|                       cinfo.output_components, spp);
#  481|   
#  482|->     jpeg_finish_decompress(&cinfo);
#  483|       jpeg_destroy_decompress(&cinfo);
#  484|       LEPT_FREE(rowbuffer);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def992]
leptonica-1.87.0/src/jpegio.c:483:5: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:339:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:394:17: branch_false: following ‘false’ branch (when ‘i >= h’)...
leptonica-1.87.0/src/jpegio.c:470:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:483:5: throw: if ‘jpeg_destroy_decompress’ throws an exception...
leptonica-1.87.0/src/jpegio.c:483:5: danger: ‘rowbuffer’ leaks here; was allocated at [(6)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/5)
#  481|   
#  482|       jpeg_finish_decompress(&cinfo);
#  483|->     jpeg_destroy_decompress(&cinfo);
#  484|       LEPT_FREE(rowbuffer);
#  485|       rowbuffer = NULL;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def993]
leptonica-1.87.0/src/jpegio.c:487:8: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nwarn’
leptonica-1.87.0/src/jpegio.c:285:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:287:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:303:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:311:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:342:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:394:17: branch_false: following ‘false’ branch (when ‘i >= h’)...
leptonica-1.87.0/src/jpegio.c:470:9: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:486:8: branch_false: following ‘false’ branch (when ‘pnwarn’ is NULL)...
leptonica-1.87.0/src/jpegio.c:487:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:487:8: danger: use of uninitialized value ‘nwarn’ here
#  485|       rowbuffer = NULL;
#  486|       if (pnwarn) *pnwarn = nwarn;
#  487|->     if (nwarn > 0)
#  488|           L_WARNING("%d warning(s) of bad data\n", __func__, nwarn);
#  489|       return pix;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def994]
leptonica-1.87.0/src/jpegio.c:813:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/jpegio.c:1112:1: enter_function: entry to ‘pixWriteMemJpeg’
leptonica-1.87.0/src/jpegio.c:1122:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1122:16: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:1123:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1131:15: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1131:15: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:1131:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1133:11: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1133:11: call_function: calling ‘pixWriteStreamJpeg’ from ‘pixWriteMemJpeg’
#  811|       if (quality <= 0) quality = 75;  /* default */
#  812|       if (quality > 100) {
#  813|->         L_ERROR("invalid jpeg quality; setting to 75\n", __func__);
#  814|           quality = 75;
#  815|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def995]
leptonica-1.87.0/src/jpegio.c:820:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/jpegio.c:1112:1: enter_function: entry to ‘pixWriteMemJpeg’
leptonica-1.87.0/src/jpegio.c:1122:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1122:16: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:1123:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1131:15: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1131:15: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:1131:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1133:11: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1133:11: call_function: calling ‘pixWriteStreamJpeg’ from ‘pixWriteMemJpeg’
#  818|            * The colormap is removed based on the source, so if the colormap
#  819|            * has only gray colors, the image will be compressed with spp = 1. */
#  820|->     pixGetDimensions(pixs, &w, &h, &d);
#  821|       pix = NULL;
#  822|       if (pixGetColormap(pixs) != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def996]
leptonica-1.87.0/src/jpegio.c:822:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/jpegio.c:1112:1: enter_function: entry to ‘pixWriteMemJpeg’
leptonica-1.87.0/src/jpegio.c:1122:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1122:16: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:1123:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1131:15: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1131:15: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:1131:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1133:11: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1133:11: call_function: calling ‘pixWriteStreamJpeg’ from ‘pixWriteMemJpeg’
#  820|       pixGetDimensions(pixs, &w, &h, &d);
#  821|       pix = NULL;
#  822|->     if (pixGetColormap(pixs) != NULL) {
#  823|           L_INFO("removing colormap; may be better to compress losslessly\n",
#  824|                  __func__);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def997]
leptonica-1.87.0/src/jpegio.c:823:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/jpegio.c:1112:1: enter_function: entry to ‘pixWriteMemJpeg’
leptonica-1.87.0/src/jpegio.c:1122:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1122:16: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:1123:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1131:15: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1131:15: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:1131:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1133:11: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1133:11: call_function: calling ‘pixWriteStreamJpeg’ from ‘pixWriteMemJpeg’
#  821|       pix = NULL;
#  822|       if (pixGetColormap(pixs) != NULL) {
#  823|->         L_INFO("removing colormap; may be better to compress losslessly\n",
#  824|                  __func__);
#  825|           pix = pixRemoveColormap(pixs, REMOVE_CMAP_BASED_ON_SRC);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def998]
leptonica-1.87.0/src/jpegio.c:825:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/jpegio.c:1112:1: enter_function: entry to ‘pixWriteMemJpeg’
leptonica-1.87.0/src/jpegio.c:1122:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1122:16: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:1123:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1131:15: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1131:15: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:1131:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1133:11: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1133:11: call_function: calling ‘pixWriteStreamJpeg’ from ‘pixWriteMemJpeg’
#  823|           L_INFO("removing colormap; may be better to compress losslessly\n",
#  824|                  __func__);
#  825|->         pix = pixRemoveColormap(pixs, REMOVE_CMAP_BASED_ON_SRC);
#  826|       } else if (d >= 8 && d != 16) {  /* normal case; no rewrite */
#  827|           pix = pixClone(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def999]
leptonica-1.87.0/src/jpegio.c:827:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/jpegio.c:1112:1: enter_function: entry to ‘pixWriteMemJpeg’
leptonica-1.87.0/src/jpegio.c:1122:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1122:16: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:1123:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1131:15: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1131:15: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:1131:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1133:11: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1133:11: call_function: calling ‘pixWriteStreamJpeg’ from ‘pixWriteMemJpeg’
#  825|           pix = pixRemoveColormap(pixs, REMOVE_CMAP_BASED_ON_SRC);
#  826|       } else if (d >= 8 && d != 16) {  /* normal case; no rewrite */
#  827|->         pix = pixClone(pixs);
#  828|       } else if (d < 8 || d == 16) {
#  829|           L_INFO("converting from %d to 8 bpp\n", __func__, d);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1000]
leptonica-1.87.0/src/jpegio.c:829:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/jpegio.c:1112:1: enter_function: entry to ‘pixWriteMemJpeg’
leptonica-1.87.0/src/jpegio.c:1122:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1122:16: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:1123:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1131:15: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1131:15: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:1131:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1133:11: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1133:11: call_function: calling ‘pixWriteStreamJpeg’ from ‘pixWriteMemJpeg’
#  827|           pix = pixClone(pixs);
#  828|       } else if (d < 8 || d == 16) {
#  829|->         L_INFO("converting from %d to 8 bpp\n", __func__, d);
#  830|           pix = pixConvertTo8(pixs, 0);  /* 8 bpp, no cmap */
#  831|       } else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1001]
leptonica-1.87.0/src/jpegio.c:830:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/jpegio.c:1112:1: enter_function: entry to ‘pixWriteMemJpeg’
leptonica-1.87.0/src/jpegio.c:1122:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1122:16: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:1123:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1125:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1127:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1131:15: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1131:15: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:1131:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1133:11: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1133:11: call_function: calling ‘pixWriteStreamJpeg’ from ‘pixWriteMemJpeg’
#  828|       } else if (d < 8 || d == 16) {
#  829|           L_INFO("converting from %d to 8 bpp\n", __func__, d);
#  830|->         pix = pixConvertTo8(pixs, 0);  /* 8 bpp, no cmap */
#  831|       } else {
#  832|           L_ERROR("unknown pix type with d = %d and no cmap\n", __func__, d);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1002]
leptonica-1.87.0/src/jpegio.c:929:12: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:807:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:811:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:835:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:837:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:846:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:853:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:923:32: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:923:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:929:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:929:12: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/jpegio.c:929:12: danger: ‘rowbuffer’ leaks here; was allocated at [(10)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/9)
#  927|       }
#  928|   
#  929|->     data = pixGetData(pix);
#  930|       wpl  = pixGetWpl(pix);
#  931|       for (i = 0; i < h; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1003]
leptonica-1.87.0/src/jpegio.c:930:12: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:807:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:811:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:835:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:837:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:846:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:853:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:923:32: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:923:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:929:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:930:12: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/jpegio.c:930:12: danger: ‘rowbuffer’ leaks here; was allocated at [(10)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/9)
#  928|   
#  929|       data = pixGetData(pix);
#  930|->     wpl  = pixGetWpl(pix);
#  931|       for (i = 0; i < h; i++) {
#  932|           line = data + i * wpl;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1004]
leptonica-1.87.0/src/jpegio.c:938:17: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:807:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:811:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:835:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:837:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:846:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:853:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:923:32: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:923:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:929:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:931:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jpegio.c:932:23: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:933:12: branch_false: following ‘false’ branch (when ‘colorflag != 0’)...
leptonica-1.87.0/src/jpegio.c:937:17: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:937:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jpegio.c:938:17: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:938:17: throw: if ‘jpeg_write_scanlines’ throws an exception...
leptonica-1.87.0/src/jpegio.c:938:17: danger: ‘rowbuffer’ leaks here; was allocated at [(10)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/9)
#  936|           } else {  /* colorflag == 1 */
#  937|               if (d == 24) {  /* See note 3 above; special case of 24 bpp rgb */
#  938|->                 jpeg_write_scanlines(&cinfo, (JSAMPROW *)&line, 1);
#  939|               } else {  /* standard 32 bpp rgb */
#  940|                   ppixel = line;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1005]
leptonica-1.87.0/src/jpegio.c:950:13: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:807:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:811:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:835:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:837:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:846:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:853:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:923:32: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:923:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:929:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:931:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jpegio.c:932:23: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:933:12: branch_true: following ‘true’ branch (when ‘colorflag == 0’)...
leptonica-1.87.0/src/jpegio.c:933:12: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:934:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:949:13: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:949:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/jpegio.c:950:13: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:950:13: throw: if ‘jpeg_write_scanlines’ throws an exception...
leptonica-1.87.0/src/jpegio.c:950:13: danger: ‘rowbuffer’ leaks here; was allocated at [(10)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/9)
#  948|           }
#  949|           if (d != 24)
#  950|->             jpeg_write_scanlines(&cinfo, &rowbuffer, 1);
#  951|       }
#  952|       jpeg_finish_compress(&cinfo);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1006]
leptonica-1.87.0/src/jpegio.c:952:5: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:807:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:811:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:835:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:837:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:846:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:853:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:923:32: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:923:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:929:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:931:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:952:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:952:5: throw: if ‘jpeg_finish_compress’ throws an exception...
leptonica-1.87.0/src/jpegio.c:952:5: danger: ‘rowbuffer’ leaks here; was allocated at [(10)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/9)
#  950|               jpeg_write_scanlines(&cinfo, &rowbuffer, 1);
#  951|       }
#  952|->     jpeg_finish_compress(&cinfo);
#  953|   
#  954|       pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1007]
leptonica-1.87.0/src/jpegio.c:954:5: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/jpegio.c:807:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:809:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:811:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:835:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:837:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:846:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/jpegio.c:846:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:853:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:923:32: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:923:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:929:12: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:931:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/jpegio.c:952:5: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:954:5: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/jpegio.c:954:5: danger: ‘rowbuffer’ leaks here; was allocated at [(10)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/9)
#  952|       jpeg_finish_compress(&cinfo);
#  953|   
#  954|->     pixDestroy(&pix);
#  955|       LEPT_FREE(rowbuffer);
#  956|       rowbuffer = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1008]
leptonica-1.87.0/src/jpegio.c:1235:15: warning[-Wanalyzer-malloc-leak]: leak of ‘comment’
leptonica-1.87.0/src/jpegio.c:1252:1: enter_function: entry to ‘jpeg_comment_callback’
leptonica-1.87.0/src/jpegio.c:1262:8: branch_false: following ‘false’ branch (when ‘length > 0’)...
leptonica-1.87.0/src/jpegio.c:1266:31: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1266:31: acquire_memory: allocated here
leptonica-1.87.0/src/jpegio.c:1266:8: branch_false: following ‘false’ branch (when ‘comment’ is non-NULL)...
leptonica-1.87.0/src/jpegio.c:1266:8: branch_false: ...to here
leptonica-1.87.0/src/jpegio.c:1268:17: branch_true: following ‘true’ branch (when ‘i < length’)...
leptonica-1.87.0/src/jpegio.c:1269:16: branch_true: ...to here
leptonica-1.87.0/src/jpegio.c:1269:22: call_function: calling ‘jpeg_getc’ from ‘jpeg_comment_callback’
# 1233|       datasrc = cinfo->src;
# 1234|       if (datasrc->bytes_in_buffer == 0) {
# 1235|->         if (! (*datasrc->fill_input_buffer) (cinfo)) {
# 1236|               return 0;
# 1237|           }

Error: CPPCHECK_WARNING (CWE-476): [#def1009]
leptonica-1.87.0/src/kernel.c:131: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: kel
#  129|   
#  130|       kel = (L_KERNEL *)LEPT_CALLOC(1, sizeof(L_KERNEL));
#  131|->     kel->sy = height;
#  132|       kel->sx = width;
#  133|       if ((kel->data = create2dFloatArray(height, width)) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1010]
leptonica-1.87.0/src/kernel.c:131:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘kel’
leptonica-1.87.0/src/kernel.c:1069:1: enter_function: entry to ‘makeFlatKernel’
leptonica-1.87.0/src/kernel.c:1078:16: call_function: calling ‘kernelCreate’ from ‘makeFlatKernel’
#  129|   
#  130|       kel = (L_KERNEL *)LEPT_CALLOC(1, sizeof(L_KERNEL));
#  131|->     kel->sy = height;
#  132|       kel->sx = width;
#  133|       if ((kel->data = create2dFloatArray(height, width)) == NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def1011]
leptonica-1.87.0/src/kernel.c:132: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: kel
#  130|       kel = (L_KERNEL *)LEPT_CALLOC(1, sizeof(L_KERNEL));
#  131|       kel->sy = height;
#  132|->     kel->sx = width;
#  133|       if ((kel->data = create2dFloatArray(height, width)) == NULL) {
#  134|           LEPT_FREE(kel);

Error: CPPCHECK_WARNING (CWE-476): [#def1012]
leptonica-1.87.0/src/kernel.c:133: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: kel
#  131|       kel->sy = height;
#  132|       kel->sx = width;
#  133|->     if ((kel->data = create2dFloatArray(height, width)) == NULL) {
#  134|           LEPT_FREE(kel);
#  135|           return (L_KERNEL *)ERROR_PTR("data not allocated", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1013]
leptonica-1.87.0/src/kernel.c:488:30: warning[-Wanalyzer-malloc-leak]: leak of ‘kel’
leptonica-1.87.0/src/kernel.c:1069:1: enter_function: entry to ‘makeFlatKernel’
leptonica-1.87.0/src/kernel.c:1078:16: call_function: calling ‘kernelCreate’ from ‘makeFlatKernel’
#  486|   
#  487|       if (sx <= 0 || sx > MaxArraySize)
#  488|->         return (l_float32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  489|       if (sy <= 0 || sy > MaxArraySize)
#  490|           return (l_float32 **)ERROR_PTR("sy out of bounds", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1014]
leptonica-1.87.0/src/kernel.c:490:30: warning[-Wanalyzer-malloc-leak]: leak of ‘kel’
leptonica-1.87.0/src/kernel.c:1069:1: enter_function: entry to ‘makeFlatKernel’
leptonica-1.87.0/src/kernel.c:1078:16: call_function: calling ‘kernelCreate’ from ‘makeFlatKernel’
#  488|           return (l_float32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  489|       if (sy <= 0 || sy > MaxArraySize)
#  490|->         return (l_float32 **)ERROR_PTR("sy out of bounds", __func__, NULL);
#  491|   
#  492|       array = (l_float32 **)LEPT_CALLOC(sy, sizeof(l_float32 *));

Error: CPPCHECK_WARNING (CWE-476): [#def1015]
leptonica-1.87.0/src/kernel.c:494: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: array
#  492|       array = (l_float32 **)LEPT_CALLOC(sy, sizeof(l_float32 *));
#  493|       for (i = 0; i < sy; i++)
#  494|->         array[i] = (l_float32 *)LEPT_CALLOC(sx, sizeof(l_float32));
#  495|       return array;
#  496|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1016]
leptonica-1.87.0/src/kernel.c:494:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘array’
leptonica-1.87.0/src/kernel.c:489:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/kernel.c:492:27: branch_false: ...to here
leptonica-1.87.0/src/kernel.c:492:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/kernel.c:493:17: branch_true: following ‘true’ branch (when ‘sy > i’)...
leptonica-1.87.0/src/kernel.c:494:33: branch_true: ...to here
leptonica-1.87.0/src/kernel.c:494:9: danger: ‘array + (long unsigned int)i * 8’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  492|       array = (l_float32 **)LEPT_CALLOC(sy, sizeof(l_float32 *));
#  493|       for (i = 0; i < sy; i++)
#  494|->         array[i] = (l_float32 *)LEPT_CALLOC(sx, sizeof(l_float32));
#  495|       return array;
#  496|   }

Error: COMPILER_WARNING: [#def1017]
leptonica-1.87.0/src/kernel.c: scope_hint: In function ‘kernelReadStream’
leptonica-1.87.0/src/kernel.c:540:48: warning[-Wunused-but-set-variable=]: variable ‘ignore’ set but not used
#  540 | l_int32    sy, sx, cy, cx, i, j, ret, version, ignore;
#      |                                                ^~~~~~
#  538|   kernelReadStream(FILE  *fp)
#  539|   {
#  540|-> l_int32    sy, sx, cy, cx, i, j, ret, version, ignore;
#  541|   L_KERNEL  *kel;
#  542|   

Error: CPPCHECK_WARNING (CWE-476): [#def1018]
leptonica-1.87.0/src/list.c:289: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cell
#  287|   
#  288|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  289|->     cell->data = data;
#  290|       if (!head) {  /* start the list; initialize the ptrs */
#  291|           cell->prev = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1019]
leptonica-1.87.0/src/list.c:289:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cell’
leptonica-1.87.0/src/list.c:282:8: branch_false: following ‘false’ branch (when ‘phead’ is non-NULL)...
leptonica-1.87.0/src/list.c:284:5: branch_false: ...to here
leptonica-1.87.0/src/list.c:285:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/list.c:288:22: branch_false: ...to here
leptonica-1.87.0/src/list.c:288:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/list.c:289:5: danger: ‘cell’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  287|   
#  288|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  289|->     cell->data = data;
#  290|       if (!head) {  /* start the list; initialize the ptrs */
#  291|           cell->prev = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def1020]
leptonica-1.87.0/src/list.c:342: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cell
#  340|   
#  341|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  342|->     cell->data = data;
#  343|       if (!head) {  /*   Start the list and initialize the ptrs.  *ptail
#  344|                      *   should also have been initialized to NULL */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1021]
leptonica-1.87.0/src/list.c:342:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cell’
leptonica-1.87.0/src/list.c:333:8: branch_false: following ‘false’ branch (when ‘phead’ is non-NULL)...
leptonica-1.87.0/src/list.c:335:5: branch_false: ...to here
leptonica-1.87.0/src/list.c:336:8: branch_false: following ‘false’ branch (when ‘ptail’ is non-NULL)...
leptonica-1.87.0/src/list.c:338:8: branch_false: ...to here
leptonica-1.87.0/src/list.c:338:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/list.c:341:22: branch_false: ...to here
leptonica-1.87.0/src/list.c:341:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/list.c:342:5: danger: ‘cell’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  340|   
#  341|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  342|->     cell->data = data;
#  343|       if (!head) {  /*   Start the list and initialize the ptrs.  *ptail
#  344|                      *   should also have been initialized to NULL */

Error: CPPCHECK_WARNING (CWE-476): [#def1022]
leptonica-1.87.0/src/list.c:402: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cell
#  400|           /* New cell to insert */
#  401|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  402|->     cell->data = data;
#  403|       if (!head) {  /* start the list; initialize the ptrs */
#  404|           cell->prev = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1023]
leptonica-1.87.0/src/list.c:402:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cell’
leptonica-1.87.0/src/list.c:392:8: branch_false: following ‘false’ branch (when ‘phead’ is non-NULL)...
leptonica-1.87.0/src/list.c:394:5: branch_false: ...to here
leptonica-1.87.0/src/list.c:395:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/list.c:397:10: branch_false: ...to here
leptonica-1.87.0/src/list.c:397:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/list.c:401:22: branch_false: ...to here
leptonica-1.87.0/src/list.c:401:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/list.c:402:5: danger: ‘cell’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  400|           /* New cell to insert */
#  401|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  402|->     cell->data = data;
#  403|       if (!head) {  /* start the list; initialize the ptrs */
#  404|           cell->prev = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def1024]
leptonica-1.87.0/src/list.c:463: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cell
#  461|           /* New cell to insert */
#  462|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  463|->     cell->data = data;
#  464|       if (!head) {  /* start the list; initialize the ptrs */
#  465|           cell->prev = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1025]
leptonica-1.87.0/src/list.c:463:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cell’
leptonica-1.87.0/src/list.c:453:8: branch_false: following ‘false’ branch (when ‘phead’ is non-NULL)...
leptonica-1.87.0/src/list.c:455:5: branch_false: ...to here
leptonica-1.87.0/src/list.c:456:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/list.c:458:10: branch_false: ...to here
leptonica-1.87.0/src/list.c:458:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/list.c:462:22: branch_false: ...to here
leptonica-1.87.0/src/list.c:462:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/list.c:463:5: danger: ‘cell’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  461|           /* New cell to insert */
#  462|       cell = (DLLIST *)LEPT_CALLOC(1, sizeof(DLLIST));
#  463|->     cell->data = data;
#  464|       if (!head) {  /* start the list; initialize the ptrs */
#  465|           cell->prev = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def1026]
leptonica-1.87.0/src/map.c:120: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: m
#  118|   
#  119|       m = (L_AMAP *)LEPT_CALLOC(1, sizeof(L_AMAP));
#  120|->     m->keytype = keytype;
#  121|       return m;
#  122|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1027]
leptonica-1.87.0/src/map.c:120:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘m’
leptonica-1.87.0/src/map.c:115:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/map.c:119:19: branch_false: ...to here
leptonica-1.87.0/src/map.c:119:19: acquire_memory: this call could return NULL
leptonica-1.87.0/src/map.c:120:5: danger: ‘m’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  118|   
#  119|       m = (L_AMAP *)LEPT_CALLOC(1, sizeof(L_AMAP));
#  120|->     m->keytype = keytype;
#  121|       return m;
#  122|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1028]
leptonica-1.87.0/src/map.c:196: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: s
#  194|   
#  195|       s = (L_ASET *)LEPT_CALLOC(1, sizeof(L_ASET));
#  196|->     s->keytype = keytype;
#  197|       return s;
#  198|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1029]
leptonica-1.87.0/src/map.c:196:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’
leptonica-1.87.0/src/map.c:191:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/map.c:195:19: branch_false: ...to here
leptonica-1.87.0/src/map.c:195:19: acquire_memory: this call could return NULL
leptonica-1.87.0/src/map.c:196:5: danger: ‘s’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  194|   
#  195|       s = (L_ASET *)LEPT_CALLOC(1, sizeof(L_ASET));
#  196|->     s->keytype = keytype;
#  197|       return s;
#  198|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1030]
leptonica-1.87.0/src/maze.c:196:5: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:145:1: enter_function: entry to ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:195:10: call_function: inlined call to ‘mazeelCreate’ from ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:196:5: throw: if ‘pixSetPixel’ throws an exception...
leptonica-1.87.0/src/maze.c:196:5: danger: ‘el’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  194|           /* Prime the queue with the first pixel; it is OFF */
#  195|       el = mazeelCreate(xi, yi, START_LOC);
#  196|->     pixSetPixel(pixm, xi, yi, 1);  /* mark visited */
#  197|       lqueueAdd(lq, el);
#  198|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1031]
leptonica-1.87.0/src/maze.c:197:5: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:145:1: enter_function: entry to ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:195:10: call_function: inlined call to ‘mazeelCreate’ from ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:197:5: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:197:5: danger: ‘el’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  195|       el = mazeelCreate(xi, yi, START_LOC);
#  196|       pixSetPixel(pixm, xi, yi, 1);  /* mark visited */
#  197|->     lqueueAdd(lq, el);
#  198|   
#  199|           /* While we're at it ... */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1032]
leptonica-1.87.0/src/maze.c:217:21: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:145:1: enter_function: entry to ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:200:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:201:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:205:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:206:31: branch_true: ...to here
leptonica-1.87.0/src/maze.c:216:26: call_function: inlined call to ‘mazeelCreate’ from ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:217:21: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:217:21: danger: ‘el’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  215|                   } else {  /* not a wall */
#  216|                       el = mazeelCreate(x - 1, y, DIR_WEST);
#  217|->                     lqueueAdd(lq, el);
#  218|                   }
#  219|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1033]
leptonica-1.87.0/src/maze.c:233:21: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:145:1: enter_function: entry to ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:200:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:201:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:205:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:206:31: branch_true: ...to here
leptonica-1.87.0/src/maze.c:221:12: branch_true: following ‘true’ branch (when ‘y > 0’)...
leptonica-1.87.0/src/maze.c:222:34: branch_true: ...to here
leptonica-1.87.0/src/maze.c:232:26: call_function: inlined call to ‘mazeelCreate’ from ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:233:21: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:233:21: danger: ‘el’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#  231|                   } else {  /* not a wall */
#  232|                       el = mazeelCreate(x, y - 1, DIR_NORTH);
#  233|->                     lqueueAdd(lq, el);
#  234|                   }
#  235|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1034]
leptonica-1.87.0/src/maze.c:249:21: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:145:1: enter_function: entry to ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:200:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:201:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:205:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:206:31: branch_true: ...to here
leptonica-1.87.0/src/maze.c:221:12: branch_true: following ‘true’ branch (when ‘y > 0’)...
leptonica-1.87.0/src/maze.c:222:34: branch_true: ...to here
leptonica-1.87.0/src/maze.c:237:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:238:31: branch_true: ...to here
leptonica-1.87.0/src/maze.c:239:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:240:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:248:26: call_function: inlined call to ‘mazeelCreate’ from ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:249:21: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:249:21: danger: ‘el’ leaks here; was allocated at [(13)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/12)
#  247|                   } else {  /* not a wall */
#  248|                       el = mazeelCreate(x + 1, y, DIR_EAST);
#  249|->                     lqueueAdd(lq, el);
#  250|                   }
#  251|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1035]
leptonica-1.87.0/src/maze.c:265:21: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:145:1: enter_function: entry to ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:200:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:201:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:205:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:206:31: branch_true: ...to here
leptonica-1.87.0/src/maze.c:221:12: branch_true: following ‘true’ branch (when ‘y > 0’)...
leptonica-1.87.0/src/maze.c:222:34: branch_true: ...to here
leptonica-1.87.0/src/maze.c:237:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:238:31: branch_true: ...to here
leptonica-1.87.0/src/maze.c:239:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:240:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:245:20: branch_true: following ‘true’ branch (when ‘testp >= frand’)...
leptonica-1.87.0/src/maze.c:246:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:255:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:256:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:259:20: branch_false: following ‘false’ branch (when ‘dir != 2’)...
leptonica-1.87.0/src/maze.c:261:20: branch_false: ...to here
leptonica-1.87.0/src/maze.c:264:26: call_function: inlined call to ‘mazeelCreate’ from ‘generateBinaryMaze’
leptonica-1.87.0/src/maze.c:265:21: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:265:21: danger: ‘el’ leaks here; was allocated at [(19)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/18)
#  263|                   } else {  /* not a wall */
#  264|                       el = mazeelCreate(x, y + 1, DIR_SOUTH);
#  265|->                     lqueueAdd(lq, el);
#  266|                   }
#  267|               }

Error: CPPCHECK_WARNING (CWE-476): [#def1036]
leptonica-1.87.0/src/maze.c:286: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: el
#  284|   
#  285|       el = (MAZEEL *)LEPT_CALLOC(1, sizeof(MAZEEL));
#  286|->     el->x = x;
#  287|       el->y = y;
#  288|       el->dir = dir;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1037]
leptonica-1.87.0/src/maze.c:286:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘el’
leptonica-1.87.0/src/maze.c:725:1: enter_function: entry to ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:745:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:747:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:752:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:754:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:770:10: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchGrayMaze’
#  284|   
#  285|       el = (MAZEEL *)LEPT_CALLOC(1, sizeof(MAZEEL));
#  286|->     el->x = x;
#  287|       el->y = y;
#  288|       el->dir = dir;

Error: CPPCHECK_WARNING (CWE-476): [#def1038]
leptonica-1.87.0/src/maze.c:287: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: el
#  285|       el = (MAZEEL *)LEPT_CALLOC(1, sizeof(MAZEEL));
#  286|       el->x = x;
#  287|->     el->y = y;
#  288|       el->dir = dir;
#  289|       return el;

Error: CPPCHECK_WARNING (CWE-476): [#def1039]
leptonica-1.87.0/src/maze.c:288: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: el
#  286|       el->x = x;
#  287|       el->y = y;
#  288|->     el->dir = dir;
#  289|       return el;
#  290|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1040]
leptonica-1.87.0/src/maze.c:393:5: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:342:1: enter_function: entry to ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:360:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:362:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:363:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:365:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:365:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:367:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:376:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:392:10: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:393:5: throw: if ‘pixSetPixel’ throws an exception...
leptonica-1.87.0/src/maze.c:393:5: danger: ‘el’ leaks here; was allocated at [(13)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/12)
#  391|           /* Prime the queue with the first pixel; it is OFF */
#  392|       el = mazeelCreate(xi, yi, 0);  /* don't need direction here */
#  393|->     pixSetPixel(pixm, xi, yi, 1);  /* mark visited */
#  394|       lqueueAdd(lq, el);
#  395|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1041]
leptonica-1.87.0/src/maze.c:394:5: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:342:1: enter_function: entry to ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:360:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:362:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:363:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:365:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:365:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:367:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:376:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:392:10: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:394:5: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:394:5: danger: ‘el’ leaks here; was allocated at [(13)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/12)
#  392|       el = mazeelCreate(xi, yi, 0);  /* don't need direction here */
#  393|       pixSetPixel(pixm, xi, yi, 1);  /* mark visited */
#  394|->     lqueueAdd(lq, el);
#  395|   
#  396|           /* Fill up the pix storing directions to parents,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1042]
leptonica-1.87.0/src/maze.c:417:21: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:342:1: enter_function: entry to ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:360:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:362:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:363:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:365:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:365:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:367:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:376:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:399:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:400:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:409:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:410:19: branch_true: ...to here
leptonica-1.87.0/src/maze.c:411:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:412:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:414:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:415:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:416:26: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:417:21: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:417:21: danger: ‘el’ leaks here; was allocated at [(21)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/20)
#  415|                       SET_DATA_BYTE(linep8[y], x - 1, DIR_EAST);  /* parent E */
#  416|                       el = mazeelCreate(x - 1, y, 0);
#  417|->                     lqueueAdd(lq, el);
#  418|                   }
#  419|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1043]
leptonica-1.87.0/src/maze.c:429:21: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:342:1: enter_function: entry to ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:360:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:362:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:363:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:365:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:365:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:367:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:376:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:399:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:400:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:409:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:410:19: branch_true: ...to here
leptonica-1.87.0/src/maze.c:411:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:412:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:414:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:415:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:421:12: branch_true: following ‘true’ branch (when ‘y > 0’)...
leptonica-1.87.0/src/maze.c:422:19: branch_true: ...to here
leptonica-1.87.0/src/maze.c:423:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:424:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:426:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:427:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:428:26: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:429:21: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:429:21: danger: ‘el’ leaks here; was allocated at [(27)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/26)
#  427|                       SET_DATA_BYTE(linep8[y - 1], x, DIR_SOUTH);  /* parent S */
#  428|                       el = mazeelCreate(x, y - 1, 0);
#  429|->                     lqueueAdd(lq, el);
#  430|                   }
#  431|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1044]
leptonica-1.87.0/src/maze.c:441:21: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:342:1: enter_function: entry to ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:360:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:362:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:363:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:365:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:365:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:367:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:376:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:399:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:400:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:409:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:410:19: branch_true: ...to here
leptonica-1.87.0/src/maze.c:411:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:412:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:414:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:415:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:421:12: branch_true: following ‘true’ branch (when ‘y > 0’)...
leptonica-1.87.0/src/maze.c:422:19: branch_true: ...to here
leptonica-1.87.0/src/maze.c:423:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:424:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:426:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:427:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:433:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:434:19: branch_true: ...to here
leptonica-1.87.0/src/maze.c:435:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:436:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:438:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:439:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:440:26: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:441:21: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:441:21: danger: ‘el’ leaks here; was allocated at [(33)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/32)
#  439|                       SET_DATA_BYTE(linep8[y], x + 1, DIR_WEST);  /* parent W */
#  440|                       el = mazeelCreate(x + 1, y, 0);
#  441|->                     lqueueAdd(lq, el);
#  442|                   }
#  443|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1045]
leptonica-1.87.0/src/maze.c:453:21: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:342:1: enter_function: entry to ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:360:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:362:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:363:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:365:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:365:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:367:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:376:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:399:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:400:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:409:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:410:19: branch_true: ...to here
leptonica-1.87.0/src/maze.c:411:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:412:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:414:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:415:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:421:12: branch_true: following ‘true’ branch (when ‘y > 0’)...
leptonica-1.87.0/src/maze.c:422:19: branch_true: ...to here
leptonica-1.87.0/src/maze.c:423:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:424:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:426:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:427:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:433:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:434:19: branch_true: ...to here
leptonica-1.87.0/src/maze.c:435:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:436:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:438:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:439:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:445:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:445:12: branch_true: ...to here
leptonica-1.87.0/src/maze.c:447:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:448:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:450:20: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:451:21: branch_true: ...to here
leptonica-1.87.0/src/maze.c:452:26: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchBinaryMaze’
leptonica-1.87.0/src/maze.c:453:21: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:453:21: danger: ‘el’ leaks here; was allocated at [(39)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/38)
#  451|                       SET_DATA_BYTE(linep8[y + 1], x, DIR_NORTH);  /* parent N */
#  452|                       el = mazeelCreate(x, y + 1, 0);
#  453|->                     lqueueAdd(lq, el);
#  454|                   }
#  455|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1046]
leptonica-1.87.0/src/maze.c:772:5: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:725:1: enter_function: entry to ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:745:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:747:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:752:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:754:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:770:10: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:772:5: throw: if ‘pixGetPixel’ throws an exception...
leptonica-1.87.0/src/maze.c:772:5: danger: ‘el’ leaks here; was allocated at [(13)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/12)
#  770|       el = mazeelCreate(xi, yi, 0);  /* don't need direction here */
#  771|       el->distance = 0;
#  772|->     pixGetPixel(pixs, xi, yi, &val);
#  773|       el->val = val;
#  774|       pixSetPixel(pixr, xi, yi, 0);  /* distance is 0 */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1047]
leptonica-1.87.0/src/maze.c:774:5: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:725:1: enter_function: entry to ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:745:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:747:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:752:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:754:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:770:10: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:774:5: throw: if ‘pixSetPixel’ throws an exception...
leptonica-1.87.0/src/maze.c:774:5: danger: ‘el’ leaks here; was allocated at [(13)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/12)
#  772|       pixGetPixel(pixs, xi, yi, &val);
#  773|       el->val = val;
#  774|->     pixSetPixel(pixr, xi, yi, 0);  /* distance is 0 */
#  775|       lheapAdd(lh, el);
#  776|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1048]
leptonica-1.87.0/src/maze.c:775:5: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:725:1: enter_function: entry to ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:745:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:747:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:752:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:754:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:770:10: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:775:5: throw: if ‘lheapAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:775:5: danger: ‘el’ leaks here; was allocated at [(13)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/12)
#  773|       el->val = val;
#  774|       pixSetPixel(pixr, xi, yi, 0);  /* distance is 0 */
#  775|->     lheapAdd(lh, el);
#  776|   
#  777|           /* Breadth-first search with priority queue (implemented by

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1049]
leptonica-1.87.0/src/maze.c:809:17: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:725:1: enter_function: entry to ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:745:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:747:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:752:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:754:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:781:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:782:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:783:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:787:9: branch_false: ...to here
leptonica-1.87.0/src/maze.c:789:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:793:31: branch_false: ...to here
leptonica-1.87.0/src/maze.c:797:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:798:20: branch_true: ...to here
leptonica-1.87.0/src/maze.c:803:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:804:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:806:22: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:809:17: throw: if ‘lheapAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:809:17: danger: ‘el’ leaks here; was allocated at [(23)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/22)
#  807|                   el->val = vals;
#  808|                   el->distance = dist;
#  809|->                 lheapAdd(lh, el);
#  810|               }
#  811|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1050]
leptonica-1.87.0/src/maze.c:824:17: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:725:1: enter_function: entry to ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:745:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:747:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:752:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:754:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:781:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:782:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:783:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:787:9: branch_false: ...to here
leptonica-1.87.0/src/maze.c:789:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:793:31: branch_false: ...to here
leptonica-1.87.0/src/maze.c:797:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:798:20: branch_true: ...to here
leptonica-1.87.0/src/maze.c:803:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:804:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:812:12: branch_true: following ‘true’ branch (when ‘y > 0’)...
leptonica-1.87.0/src/maze.c:813:20: branch_true: ...to here
leptonica-1.87.0/src/maze.c:818:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:819:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:821:22: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:824:17: throw: if ‘lheapAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:824:17: danger: ‘el’ leaks here; was allocated at [(27)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/26)
#  822|                   el->val = vals;
#  823|                   el->distance = dist;
#  824|->                 lheapAdd(lh, el);
#  825|               }
#  826|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1051]
leptonica-1.87.0/src/maze.c:839:17: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:725:1: enter_function: entry to ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:745:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:747:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:752:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:754:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:781:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:782:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:783:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:787:9: branch_false: ...to here
leptonica-1.87.0/src/maze.c:789:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:793:31: branch_false: ...to here
leptonica-1.87.0/src/maze.c:797:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:798:20: branch_true: ...to here
leptonica-1.87.0/src/maze.c:803:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:804:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:812:12: branch_true: following ‘true’ branch (when ‘y > 0’)...
leptonica-1.87.0/src/maze.c:813:20: branch_true: ...to here
leptonica-1.87.0/src/maze.c:818:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:819:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:827:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:828:20: branch_true: ...to here
leptonica-1.87.0/src/maze.c:833:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:834:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:836:22: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:839:17: throw: if ‘lheapAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:839:17: danger: ‘el’ leaks here; was allocated at [(31)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/30)
#  837|                   el->val = vals;
#  838|                   el->distance = dist;
#  839|->                 lheapAdd(lh, el);
#  840|               }
#  841|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1052]
leptonica-1.87.0/src/maze.c:854:17: warning[-Wanalyzer-malloc-leak]: leak of ‘el’
leptonica-1.87.0/src/maze.c:725:1: enter_function: entry to ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:745:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/maze.c:747:5: branch_false: ...to here
leptonica-1.87.0/src/maze.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:752:8: branch_false: ...to here
leptonica-1.87.0/src/maze.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:754:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:781:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:782:25: branch_true: ...to here
leptonica-1.87.0/src/maze.c:783:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:787:9: branch_false: ...to here
leptonica-1.87.0/src/maze.c:789:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/maze.c:793:31: branch_false: ...to here
leptonica-1.87.0/src/maze.c:797:12: branch_true: following ‘true’ branch (when ‘x > 0’)...
leptonica-1.87.0/src/maze.c:798:20: branch_true: ...to here
leptonica-1.87.0/src/maze.c:803:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:804:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:812:12: branch_true: following ‘true’ branch (when ‘y > 0’)...
leptonica-1.87.0/src/maze.c:813:20: branch_true: ...to here
leptonica-1.87.0/src/maze.c:818:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:819:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:827:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:828:20: branch_true: ...to here
leptonica-1.87.0/src/maze.c:833:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:834:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:842:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:842:12: branch_true: ...to here
leptonica-1.87.0/src/maze.c:848:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/maze.c:849:17: branch_true: ...to here
leptonica-1.87.0/src/maze.c:851:22: call_function: inlined call to ‘mazeelCreate’ from ‘pixSearchGrayMaze’
leptonica-1.87.0/src/maze.c:854:17: throw: if ‘lheapAdd’ throws an exception...
leptonica-1.87.0/src/maze.c:854:17: danger: ‘el’ leaks here; was allocated at [(35)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/34)
#  852|                   el->val = vals;
#  853|                   el->distance = dist;
#  854|->                 lheapAdd(lh, el);
#  855|               }
#  856|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1053]
leptonica-1.87.0/src/morph.c:228:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sel’
leptonica-1.87.0/src/morph.c:1531:1: enter_function: entry to ‘pixCloseCompBrick’
leptonica-1.87.0/src/morph.c:1537:7: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1538:7: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1539:7: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1540:7: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1542:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/morph.c:1544:9: branch_false: ...to here
leptonica-1.87.0/src/morph.c:1544:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/morph.c:1546:9: branch_false: ...to here
leptonica-1.87.0/src/morph.c:1546:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/morph.c:1549:9: branch_false: ...to here
leptonica-1.87.0/src/morph.c:1549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/morph.c:1551:8: branch_false: ...to here
leptonica-1.87.0/src/morph.c:1568:8: branch_true: following ‘true’ branch (when ‘vsize == 1’)...
leptonica-1.87.0/src/morph.c:1569:16: branch_true: ...to here
leptonica-1.87.0/src/morph.c:1569:16: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1569:16: call_function: calling ‘pixDilate’ from ‘pixCloseCompBrick’
#  226|       for (i = 0; i < sy; i++) {
#  227|           for (j = 0; j < sx; j++) {
#  228|->             seldata = sel->data[i][j];
#  229|               if (seldata == 1) {   /* src | dst */
#  230|                   pixRasterop(pixd, j - cx, i - cy, w, h, PIX_SRC | PIX_DST,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1054]
leptonica-1.87.0/src/morph.c:281:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sel’
leptonica-1.87.0/src/morph.c:1531:1: enter_function: entry to ‘pixCloseCompBrick’
leptonica-1.87.0/src/morph.c:1537:7: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1538:7: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1539:7: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1540:7: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1542:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/morph.c:1544:9: branch_false: ...to here
leptonica-1.87.0/src/morph.c:1544:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/morph.c:1546:9: branch_false: ...to here
leptonica-1.87.0/src/morph.c:1546:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/morph.c:1549:9: branch_false: ...to here
leptonica-1.87.0/src/morph.c:1549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/morph.c:1551:8: branch_false: ...to here
leptonica-1.87.0/src/morph.c:1568:8: branch_true: following ‘true’ branch (when ‘vsize == 1’)...
leptonica-1.87.0/src/morph.c:1569:16: branch_true: ...to here
leptonica-1.87.0/src/morph.c:1569:16: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1569:16: call_function: calling ‘pixDilate’ from ‘pixCloseCompBrick’
leptonica-1.87.0/src/morph.c:1569:16: return_function: returning to ‘pixCloseCompBrick’ from ‘pixDilate’
leptonica-1.87.0/src/morph.c:1570:16: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1570:16: call_function: calling ‘pixDilate’ from ‘pixCloseCompBrick’
leptonica-1.87.0/src/morph.c:1570:16: return_function: returning to ‘pixCloseCompBrick’ from ‘pixDilate’
leptonica-1.87.0/src/morph.c:1571:9: release_memory: ‘selh1’ is NULL
leptonica-1.87.0/src/morph.c:1571:9: call_function: calling ‘pixErode’ from ‘pixCloseCompBrick’
#  279|       for (i = 0; i < sy; i++) {
#  280|           for (j = 0; j < sx; j++) {
#  281|->             seldata = sel->data[i][j];
#  282|               if (seldata == 1) {   /* src & dst */
#  283|                       pixRasterop(pixd, cx - j, cy - i, w, h, PIX_SRC & PIX_DST,

Error: CPPCHECK_WARNING (CWE-476): [#def1055]
leptonica-1.87.0/src/numabasic.c:201: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: na
#  199|   
#  200|       na = (NUMA *)LEPT_CALLOC(1, sizeof(NUMA));
#  201|->     if ((na->array = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32))) == NULL) {
#  202|           numaDestroy(&na);
#  203|           return (NUMA *)ERROR_PTR("number array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1056]
leptonica-1.87.0/src/numabasic.c:201:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘na’
leptonica-1.87.0/src/numabasic.c:387:1: enter_function: entry to ‘numaCopy’
leptonica-1.87.0/src/numabasic.c:395:16: call_function: calling ‘numaCreate’ from ‘numaCopy’
#  199|   
#  200|       na = (NUMA *)LEPT_CALLOC(1, sizeof(NUMA));
#  201|->     if ((na->array = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32))) == NULL) {
#  202|           numaDestroy(&na);
#  203|           return (NUMA *)ERROR_PTR("number array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def1057]
leptonica-1.87.0/src/numabasic.c:206: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: na
#  204|       }
#  205|   
#  206|->     na->nalloc = n;
#  207|       na->n = 0;
#  208|       na->refcount = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def1058]
leptonica-1.87.0/src/numabasic.c:207: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: na
#  205|   
#  206|       na->nalloc = n;
#  207|->     na->n = 0;
#  208|       na->refcount = 1;
#  209|       na->startx = 0.0;

Error: CPPCHECK_WARNING (CWE-476): [#def1059]
leptonica-1.87.0/src/numabasic.c:208: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: na
#  206|       na->nalloc = n;
#  207|       na->n = 0;
#  208|->     na->refcount = 1;
#  209|       na->startx = 0.0;
#  210|       na->delx = 1.0;

Error: CPPCHECK_WARNING (CWE-476): [#def1060]
leptonica-1.87.0/src/numabasic.c:209: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: na
#  207|       na->n = 0;
#  208|       na->refcount = 1;
#  209|->     na->startx = 0.0;
#  210|       na->delx = 1.0;
#  211|       return na;

Error: CPPCHECK_WARNING (CWE-476): [#def1061]
leptonica-1.87.0/src/numabasic.c:210: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: na
#  208|       na->refcount = 1;
#  209|       na->startx = 0.0;
#  210|->     na->delx = 1.0;
#  211|       return na;
#  212|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1062]
leptonica-1.87.0/src/numabasic.c:377:1: warning[-Wanalyzer-malloc-leak]: leak of ‘na’
leptonica-1.87.0/src/numabasic.c:387:1: enter_function: entry to ‘numaCopy’
leptonica-1.87.0/src/numabasic.c:395:16: call_function: calling ‘numaCreate’ from ‘numaCopy’
#  375|   
#  376|       *pna = NULL;
#  377|-> }
#  378|   
#  379|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1063]
leptonica-1.87.0/src/numabasic.c:417:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/numabasic.c:1927:1: enter_function: entry to ‘numaaWriteMem’
leptonica-1.87.0/src/numabasic.c:1935:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/numabasic.c:1935:16: branch_true: ...to here
leptonica-1.87.0/src/numabasic.c:1936:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/numabasic.c:1938:8: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1938:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/numabasic.c:1940:8: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1940:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numabasic.c:1944:15: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1944:15: acquire_memory: allocated here
leptonica-1.87.0/src/numabasic.c:1944:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/numabasic.c:1946:11: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1946:11: call_function: calling ‘numaaWriteStream’ from ‘numaaWriteMem’
#  415|   {
#  416|       if (!na)
#  417|->         return (NUMA *)ERROR_PTR("na not defined", __func__, NULL);
#  418|   
#  419|       ++na->refcount;

Error: CPPCHECK_WARNING (CWE-476): [#def1064]
leptonica-1.87.0/src/numabasic.c:1314: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: naa
# 1312|   
# 1313|       naa = (NUMAA *)LEPT_CALLOC(1, sizeof(NUMAA));
# 1314|->     if ((naa->numa = (NUMA **)LEPT_CALLOC(n, sizeof(NUMA *))) == NULL) {
# 1315|           numaaDestroy(&naa);
# 1316|           return (NUMAA *)ERROR_PTR("numa ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1065]
leptonica-1.87.0/src/numabasic.c:1314:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘naa’
leptonica-1.87.0/src/numabasic.c:1784:1: enter_function: entry to ‘numaaReadStream’
leptonica-1.87.0/src/numabasic.c:1794:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numabasic.c:1796:9: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1796:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numabasic.c:1798:9: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1798:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numabasic.c:1801:9: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1801:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numabasic.c:1805:16: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1805:16: call_function: calling ‘numaaCreate’ from ‘numaaReadStream’
# 1312|   
# 1313|       naa = (NUMAA *)LEPT_CALLOC(1, sizeof(NUMAA));
# 1314|->     if ((naa->numa = (NUMA **)LEPT_CALLOC(n, sizeof(NUMA *))) == NULL) {
# 1315|           numaaDestroy(&naa);
# 1316|           return (NUMAA *)ERROR_PTR("numa ptr array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def1066]
leptonica-1.87.0/src/numabasic.c:1319: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: naa
# 1317|       }
# 1318|   
# 1319|->     naa->nalloc = n;
# 1320|       naa->n = 0;
# 1321|       return naa;

Error: CPPCHECK_WARNING (CWE-476): [#def1067]
leptonica-1.87.0/src/numabasic.c:1320: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: naa
# 1318|   
# 1319|       naa->nalloc = n;
# 1320|->     naa->n = 0;
# 1321|       return naa;
# 1322|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1068]
leptonica-1.87.0/src/numabasic.c:1628:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/numabasic.c:1927:1: enter_function: entry to ‘numaaWriteMem’
leptonica-1.87.0/src/numabasic.c:1935:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/numabasic.c:1935:16: branch_true: ...to here
leptonica-1.87.0/src/numabasic.c:1936:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/numabasic.c:1938:8: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1938:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/numabasic.c:1940:8: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1940:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numabasic.c:1944:15: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1944:15: acquire_memory: allocated here
leptonica-1.87.0/src/numabasic.c:1944:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/numabasic.c:1946:11: branch_false: ...to here
leptonica-1.87.0/src/numabasic.c:1946:11: call_function: calling ‘numaaWriteStream’ from ‘numaaWriteMem’
# 1626|           return (NUMA *)ERROR_PTR("naa not defined", __func__, NULL);
# 1627|       if (index < 0 || index >= naa->n)
# 1628|->         return (NUMA *)ERROR_PTR("index not valid", __func__, NULL);
# 1629|   
# 1630|       if (accessflag == L_COPY)

Error: CPPCHECK_WARNING (CWE-457): [#def1069]
leptonica-1.87.0/src/numafunc1.c:1476: warning[uninitvar]: Uninitialized variable: istart
# 1474|               break;
# 1475|       }
# 1476|->     if (istart == n)  /* no intervals found */
# 1477|           return nad;
# 1478|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1070]
leptonica-1.87.0/src/numafunc1.c:1476:8: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘istart’
leptonica-1.87.0/src/numafunc1.c:1432:1: enter_function: entry to ‘numaThresholdEdges’
leptonica-1.87.0/src/numafunc1.c:1442:8: branch_false: following ‘false’ branch (when ‘nas’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1444:14: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1444:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1446:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1446:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1448:8: branch_false: following ‘false’ branch (when ‘thresh1 <= thresh2’)...
leptonica-1.87.0/src/numafunc1.c:1454:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1458:5: call_function: calling ‘numaGetMax’ from ‘numaThresholdEdges’
leptonica-1.87.0/src/numafunc1.c:1458:5: return_function: returning to ‘numaThresholdEdges’ from ‘numaGetMax’
leptonica-1.87.0/src/numafunc1.c:1468:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1476:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1476:8: danger: use of uninitialized value ‘istart’ here
# 1474|               break;
# 1475|       }
# 1476|->     if (istart == n)  /* no intervals found */
# 1477|           return nad;
# 1478|   

Error: COMPILER_WARNING (CWE-457): [#def1071]
leptonica-1.87.0/src/numafunc1.c: scope_hint: In function ‘numaThresholdEdges’
leptonica-1.87.0/src/numafunc1.c:1476:8: warning[-Wmaybe-uninitialized]: ‘istart’ may be used uninitialized
# 1476 |     if (istart == n)  /* no intervals found */
#      |        ^
leptonica-1.87.0/src/numafunc1.c:1437:18: note: ‘istart’ was declared here
# 1437 | l_int32    n, i, istart, inband, output, sign;
#      |                  ^~~~~~
# 1474|               break;
# 1475|       }
# 1476|->     if (istart == n)  /* no intervals found */
# 1477|           return nad;
# 1478|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1072]
leptonica-1.87.0/src/numafunc1.c:2007:12: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/numafunc1.c:1934:1: enter_function: entry to ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1949:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1949:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1950:8: branch_false: following ‘false’ branch (when ‘pnady’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1952:5: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1953:8: branch_false: following ‘false’ branch (when ‘nay’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: following ‘false’ branch (when ‘nax’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1957:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1957:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: following ‘false’ branch (when ‘x0 <= x1’)...
leptonica-1.87.0/src/numafunc1.c:1961:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1963:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1967:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1971:5: call_function: calling ‘numaGetMin’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1971:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMin’
leptonica-1.87.0/src/numafunc1.c:1972:5: call_function: calling ‘numaGetMax’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1972:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMax’
leptonica-1.87.0/src/numafunc1.c:1973:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1977:5: call_function: calling ‘numaIsSorted’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1977:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaIsSorted’
leptonica-1.87.0/src/numafunc1.c:1978:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1982:16: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1990:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:1990:8: branch_false: following ‘false’ branch (when ‘index’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1995:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1996:24: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2007:12: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2007:12: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:2007:12: danger: ‘index’ leaks here; was allocated at [(57)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/56)
# 2005|   
# 2006|           /* For each point to be interpolated, get the y value */
# 2007|->     nady = numaCreate(npts);
# 2008|       *pnady = nady;
# 2009|       if (pnadx) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1073]
leptonica-1.87.0/src/numafunc1.c:2010:16: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/numafunc1.c:1934:1: enter_function: entry to ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1949:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1949:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1950:8: branch_false: following ‘false’ branch (when ‘pnady’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1952:5: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1953:8: branch_false: following ‘false’ branch (when ‘nay’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: following ‘false’ branch (when ‘nax’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1957:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1957:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: following ‘false’ branch (when ‘x0 <= x1’)...
leptonica-1.87.0/src/numafunc1.c:1961:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1963:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1967:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1971:5: call_function: calling ‘numaGetMin’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1971:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMin’
leptonica-1.87.0/src/numafunc1.c:1972:5: call_function: calling ‘numaGetMax’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1972:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMax’
leptonica-1.87.0/src/numafunc1.c:1973:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1977:5: call_function: calling ‘numaIsSorted’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1977:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaIsSorted’
leptonica-1.87.0/src/numafunc1.c:1978:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1982:16: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1990:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:1990:8: branch_false: following ‘false’ branch (when ‘index’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1995:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1996:24: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2007:12: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2009:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2010:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2010:16: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:2010:16: danger: ‘index’ leaks here; was allocated at [(57)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/56)
# 2008|       *pnady = nady;
# 2009|       if (pnadx) {
# 2010|->         nadx = numaCreate(npts);
# 2011|           *pnadx = nadx;
# 2012|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1074]
leptonica-1.87.0/src/numafunc1.c:2016:13: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/numafunc1.c:1934:1: enter_function: entry to ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1949:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1949:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1950:8: branch_false: following ‘false’ branch (when ‘pnady’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1952:5: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1953:8: branch_false: following ‘false’ branch (when ‘nay’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: following ‘false’ branch (when ‘nax’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1957:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1957:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: following ‘false’ branch (when ‘x0 <= x1’)...
leptonica-1.87.0/src/numafunc1.c:1961:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1963:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1967:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1971:5: call_function: calling ‘numaGetMin’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1971:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMin’
leptonica-1.87.0/src/numafunc1.c:1972:5: call_function: calling ‘numaGetMax’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1972:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMax’
leptonica-1.87.0/src/numafunc1.c:1973:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1977:5: call_function: calling ‘numaIsSorted’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1977:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaIsSorted’
leptonica-1.87.0/src/numafunc1.c:1978:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1982:16: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1990:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:1990:8: branch_false: following ‘false’ branch (when ‘index’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1995:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1996:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:1997:21: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1998:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:1998:40: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1996:24: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2007:12: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2009:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2010:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2013:17: branch_true: following ‘true’ branch (when ‘i < npts’)...
leptonica-1.87.0/src/numafunc1.c:2014:21: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2015:12: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2016:13: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2016:13: throw: if ‘numaAddNumber’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:2016:13: danger: ‘index’ leaks here; was allocated at [(57)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/56)
# 2014|           xval = x0 + i * del;
# 2015|           if (pnadx)
# 2016|->             numaAddNumber(nadx, xval);
# 2017|           im = index[i];
# 2018|           excess = xval - fax[im];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1075]
leptonica-1.87.0/src/numafunc1.c:2020:13: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/numafunc1.c:1934:1: enter_function: entry to ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1949:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1949:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1950:8: branch_false: following ‘false’ branch (when ‘pnady’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1952:5: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1953:8: branch_false: following ‘false’ branch (when ‘nay’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: following ‘false’ branch (when ‘nax’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1957:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1957:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: following ‘false’ branch (when ‘x0 <= x1’)...
leptonica-1.87.0/src/numafunc1.c:1961:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1963:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1967:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1971:5: call_function: calling ‘numaGetMin’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1971:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMin’
leptonica-1.87.0/src/numafunc1.c:1972:5: call_function: calling ‘numaGetMax’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1972:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMax’
leptonica-1.87.0/src/numafunc1.c:1973:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1977:5: call_function: calling ‘numaIsSorted’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1977:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaIsSorted’
leptonica-1.87.0/src/numafunc1.c:1978:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1982:16: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1990:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:1990:8: branch_false: following ‘false’ branch (when ‘index’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1995:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1996:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:1997:21: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1998:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:1998:40: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1996:24: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2007:12: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2009:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2010:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2013:17: branch_true: following ‘true’ branch (when ‘i < npts’)...
leptonica-1.87.0/src/numafunc1.c:2014:21: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2015:12: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2016:13: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2019:12: branch_true: following ‘true’ branch (when ‘excess == 0.0f’)...
leptonica-1.87.0/src/numafunc1.c:2020:36: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2020:13: throw: if ‘numaAddNumber’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:2020:13: danger: ‘index’ leaks here; was allocated at [(57)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/56)
# 2018|           excess = xval - fax[im];
# 2019|           if (excess == 0.0) {
# 2020|->             numaAddNumber(nady, fay[im]);
# 2021|               continue;
# 2022|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1076]
leptonica-1.87.0/src/numafunc1.c:2027:13: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/numafunc1.c:1934:1: enter_function: entry to ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1949:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1949:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1950:8: branch_false: following ‘false’ branch (when ‘pnady’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1952:5: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1953:8: branch_false: following ‘false’ branch (when ‘nay’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: following ‘false’ branch (when ‘nax’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1957:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1957:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: following ‘false’ branch (when ‘x0 <= x1’)...
leptonica-1.87.0/src/numafunc1.c:1961:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1963:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1967:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1971:5: call_function: calling ‘numaGetMin’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1971:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMin’
leptonica-1.87.0/src/numafunc1.c:1972:5: call_function: calling ‘numaGetMax’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1972:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMax’
leptonica-1.87.0/src/numafunc1.c:1973:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1977:5: call_function: calling ‘numaIsSorted’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1977:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaIsSorted’
leptonica-1.87.0/src/numafunc1.c:1978:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1982:16: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1990:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:1990:8: branch_false: following ‘false’ branch (when ‘index’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1995:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1996:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:1997:21: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1998:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:1998:40: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1996:24: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2007:12: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2009:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2010:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2013:17: branch_true: following ‘true’ branch (when ‘i < npts’)...
leptonica-1.87.0/src/numafunc1.c:2014:21: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2015:12: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2016:13: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2019:12: branch_false: following ‘false’ branch (when ‘excess != 0.0f’)...
leptonica-1.87.0/src/numafunc1.c:2023:31: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2025:12: branch_true: following ‘true’ branch (when ‘type == 1’)...
leptonica-1.87.0/src/numafunc1.c:2026:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2027:13: throw: if ‘numaAddNumber’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:2027:13: danger: ‘index’ leaks here; was allocated at [(57)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/56)
# 2025|           if (type == L_LINEAR_INTERP) {
# 2026|               yval = fay[im] + fract * (fay[im + 1] - fay[im]);
# 2027|->             numaAddNumber(nady, yval);
# 2028|               continue;
# 2029|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1077]
leptonica-1.87.0/src/numafunc1.c:2047:9: warning[-Wanalyzer-malloc-leak]: leak of ‘index’
leptonica-1.87.0/src/numafunc1.c:1934:1: enter_function: entry to ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1949:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1949:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1950:8: branch_false: following ‘false’ branch (when ‘pnady’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1952:5: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1953:8: branch_false: following ‘false’ branch (when ‘nay’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1955:8: branch_false: following ‘false’ branch (when ‘nax’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1957:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1957:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1959:8: branch_false: following ‘false’ branch (when ‘x0 <= x1’)...
leptonica-1.87.0/src/numafunc1.c:1961:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1963:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1965:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1967:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1971:5: call_function: calling ‘numaGetMin’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1971:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMin’
leptonica-1.87.0/src/numafunc1.c:1972:5: call_function: calling ‘numaGetMax’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1972:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaGetMax’
leptonica-1.87.0/src/numafunc1.c:1973:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1977:5: call_function: calling ‘numaIsSorted’ from ‘numaInterpolateArbxInterval’
leptonica-1.87.0/src/numafunc1.c:1977:5: return_function: returning to ‘numaInterpolateArbxInterval’ from ‘numaIsSorted’
leptonica-1.87.0/src/numafunc1.c:1978:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:1982:16: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1990:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:1990:8: branch_false: following ‘false’ branch (when ‘index’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:1995:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:1996:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:1997:21: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1998:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:1998:40: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:1996:24: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2007:12: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2009:8: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2010:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2013:17: branch_true: following ‘true’ branch (when ‘i < npts’)...
leptonica-1.87.0/src/numafunc1.c:2014:21: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2015:12: branch_true: following ‘true’ branch (when ‘pnadx’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2016:13: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2025:12: branch_false: following ‘false’ branch (when ‘type != 1’)...
leptonica-1.87.0/src/numafunc1.c:2032:12: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2047:9: throw: if ‘numaAddNumber’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:2047:9: danger: ‘index’ leaks here; was allocated at [(57)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/56)
# 2045|                  fay[i2] * (xval - fax[i1]) * (xval - fax[i3]) / d2 +
# 2046|                  fay[i3] * (xval - fax[i1]) * (xval - fax[i2]) / d3;
# 2047|->         numaAddNumber(nady, yval);
# 2048|       }
# 2049|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1078]
leptonica-1.87.0/src/numafunc1.c:2712:15: warning[-Wanalyzer-malloc-leak]: leak of ‘iarray’
leptonica-1.87.0/src/numafunc1.c:2675:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2679:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2679:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2682:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2683:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2685:32: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2685:32: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:2685:8: branch_false: following ‘false’ branch (when ‘iarray’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2685:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2689:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2693:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2693:21: branch_false: following ‘false’ branch (when ‘gap <= 0’)...
leptonica-1.87.0/src/numafunc1.c:2712:15: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2712:15: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:2712:15: danger: ‘iarray’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
# 2710|       }
# 2711|   
# 2712|->     naisort = numaCreate(n);
# 2713|       for (i = 0; i < n; i++)
# 2714|           numaAddNumber(naisort, iarray[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1079]
leptonica-1.87.0/src/numafunc1.c:2714:9: warning[-Wanalyzer-malloc-leak]: leak of ‘iarray’
leptonica-1.87.0/src/numafunc1.c:2675:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2679:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2679:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2682:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2683:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2685:32: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2685:32: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:2685:8: branch_false: following ‘false’ branch (when ‘iarray’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:2685:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2689:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:2690:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2713:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:2714:38: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2714:9: throw: if ‘numaAddNumber’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:2714:9: danger: ‘iarray’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
# 2712|       naisort = numaCreate(n);
# 2713|       for (i = 0; i < n; i++)
# 2714|->         numaAddNumber(naisort, iarray[i]);
# 2715|   
# 2716|       LEPT_FREE(array);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1080]
leptonica-1.87.0/src/numafunc1.c:2988:9: warning[-Wanalyzer-malloc-leak]: leak of ‘test’
leptonica-1.87.0/src/numafunc1.c:2979:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2984:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2985:23: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:2987:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:2988:9: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2988:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:2988:9: danger: ‘test’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
# 2986|       error = 0;
# 2987|       for (i = 0; i < n; i++) {
# 2988|->         numaGetIValue(nas, i, &val);
# 2989|           if (val >= n) {
# 2990|               error = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1081]
leptonica-1.87.0/src/numafunc1.c:2993:9: warning[-Wanalyzer-malloc-leak]: leak of ‘test’
leptonica-1.87.0/src/numafunc1.c:2979:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2984:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2985:23: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:2987:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc1.c:2988:9: branch_true: ...to here
leptonica-1.87.0/src/numafunc1.c:2989:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc1.c:2993:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:2993:9: throw: if ‘numaReplaceNumber’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:2993:9: danger: ‘test’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
# 2991|               break;
# 2992|           }
# 2993|->         numaReplaceNumber(nad, val, i);
# 2994|           if (test[val] == 0) {
# 2995|               test[val] = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def1082]
leptonica-1.87.0/src/numafunc1.c:2994: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: test
# 2992|           }
# 2993|           numaReplaceNumber(nad, val, i);
# 2994|->         if (test[val] == 0) {
# 2995|               test[val] = 1;
# 2996|           } else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1083]
leptonica-1.87.0/src/numafunc1.c:3174:10: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/numafunc1.c:3161:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc1.c:3161:8: branch_false: following ‘false’ branch (when ‘array’ is non-NULL)...
leptonica-1.87.0/src/numafunc1.c:3161:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:3163:17: branch_false: following ‘false’ branch (when ‘size <= i’)...
leptonica-1.87.0/src/numafunc1.c:3165:5: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:3166:24: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/numafunc1.c:3174:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc1.c:3174:10: throw: if ‘numaCreateFromIArray’ throws an exception...
leptonica-1.87.0/src/numafunc1.c:3174:10: danger: ‘array’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
# 3172|       }
# 3173|   
# 3174|->     na = numaCreateFromIArray(array, size);
# 3175|       LEPT_FREE(array);
# 3176|       return na;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1084]
leptonica-1.87.0/src/numafunc2.c:216:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fas’
leptonica-1.87.0/src/numafunc2.c:191:8: branch_false: following ‘false’ branch (when ‘nas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:193:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:193:8: branch_false: following ‘false’ branch (when ‘size > 0’)...
leptonica-1.87.0/src/numafunc2.c:195:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:200:8: branch_false: following ‘false’ branch (when ‘size != 1’)...
leptonica-1.87.0/src/numafunc2.c:207:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:210:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:210:8: branch_false: following ‘false’ branch (when ‘fas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:210:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:212:17: branch_false: following ‘false’ branch (when ‘i >= hsize’)...
leptonica-1.87.0/src/numafunc2.c:214:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:214:25: branch_false: following ‘false’ branch (when ‘i >= len’)...
leptonica-1.87.0/src/numafunc2.c:216:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:216:10: throw: if ‘numaGetFArray’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:216:10: danger: ‘fas’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  214|       for (i = hsize + n; i < len; i++)
#  215|            fas[i] = 1.0e37f;
#  216|->     fa = numaGetFArray(nas, L_NOCOPY);
#  217|       for (i = 0; i < n; i++)
#  218|            fas[hsize + i] = fa[i];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1085]
leptonica-1.87.0/src/numafunc2.c:220:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fas’
leptonica-1.87.0/src/numafunc2.c:191:8: branch_false: following ‘false’ branch (when ‘nas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:193:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:193:8: branch_false: following ‘false’ branch (when ‘size > 0’)...
leptonica-1.87.0/src/numafunc2.c:195:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:200:8: branch_false: following ‘false’ branch (when ‘size != 1’)...
leptonica-1.87.0/src/numafunc2.c:207:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:210:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:210:8: branch_false: following ‘false’ branch (when ‘fas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:210:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:212:17: branch_false: following ‘false’ branch (when ‘i >= hsize’)...
leptonica-1.87.0/src/numafunc2.c:214:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:214:25: branch_false: following ‘false’ branch (when ‘i >= len’)...
leptonica-1.87.0/src/numafunc2.c:216:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:217:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:220:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:220:11: throw: if ‘numaMakeConstant’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:220:11: danger: ‘fas’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  218|            fas[hsize + i] = fa[i];
#  219|   
#  220|->     nad = numaMakeConstant(0, n);
#  221|       numaCopyParameters(nad, nas);
#  222|       fad = numaGetFArray(nad, L_NOCOPY);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1086]
leptonica-1.87.0/src/numafunc2.c:221:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fas’
leptonica-1.87.0/src/numafunc2.c:191:8: branch_false: following ‘false’ branch (when ‘nas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:193:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:193:8: branch_false: following ‘false’ branch (when ‘size > 0’)...
leptonica-1.87.0/src/numafunc2.c:195:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:200:8: branch_false: following ‘false’ branch (when ‘size != 1’)...
leptonica-1.87.0/src/numafunc2.c:207:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:210:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:210:8: branch_false: following ‘false’ branch (when ‘fas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:210:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:212:17: branch_false: following ‘false’ branch (when ‘i >= hsize’)...
leptonica-1.87.0/src/numafunc2.c:214:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:214:25: branch_false: following ‘false’ branch (when ‘i >= len’)...
leptonica-1.87.0/src/numafunc2.c:216:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:217:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:220:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:221:5: throw: if ‘numaCopyParameters’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:221:5: danger: ‘fas’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  219|   
#  220|       nad = numaMakeConstant(0, n);
#  221|->     numaCopyParameters(nad, nas);
#  222|       fad = numaGetFArray(nad, L_NOCOPY);
#  223|       for (i = 0; i < n; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1087]
leptonica-1.87.0/src/numafunc2.c:222:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fas’
leptonica-1.87.0/src/numafunc2.c:191:8: branch_false: following ‘false’ branch (when ‘nas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:193:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:193:8: branch_false: following ‘false’ branch (when ‘size > 0’)...
leptonica-1.87.0/src/numafunc2.c:195:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:200:8: branch_false: following ‘false’ branch (when ‘size != 1’)...
leptonica-1.87.0/src/numafunc2.c:207:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:210:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:210:8: branch_false: following ‘false’ branch (when ‘fas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:210:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:212:17: branch_false: following ‘false’ branch (when ‘i >= hsize’)...
leptonica-1.87.0/src/numafunc2.c:214:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:214:25: branch_false: following ‘false’ branch (when ‘i >= len’)...
leptonica-1.87.0/src/numafunc2.c:216:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:217:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:220:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:222:11: throw: if ‘numaGetFArray’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:222:11: danger: ‘fas’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  220|       nad = numaMakeConstant(0, n);
#  221|       numaCopyParameters(nad, nas);
#  222|->     fad = numaGetFArray(nad, L_NOCOPY);
#  223|       for (i = 0; i < n; i++) {
#  224|           minval = 1.0e37f;  /* start big */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1088]
leptonica-1.87.0/src/numafunc2.c:283:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fas’
leptonica-1.87.0/src/numafunc2.c:258:8: branch_false: following ‘false’ branch (when ‘nas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:260:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:260:8: branch_false: following ‘false’ branch (when ‘size > 0’)...
leptonica-1.87.0/src/numafunc2.c:262:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:267:8: branch_false: following ‘false’ branch (when ‘size != 1’)...
leptonica-1.87.0/src/numafunc2.c:274:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:277:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:277:8: branch_false: following ‘false’ branch (when ‘fas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:277:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:279:17: branch_false: following ‘false’ branch (when ‘i >= hsize’)...
leptonica-1.87.0/src/numafunc2.c:281:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:281:25: branch_false: following ‘false’ branch (when ‘i >= len’)...
leptonica-1.87.0/src/numafunc2.c:283:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:283:10: throw: if ‘numaGetFArray’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:283:10: danger: ‘fas’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  281|       for (i = hsize + n; i < len; i++)
#  282|            fas[i] = -1.0e37f;
#  283|->     fa = numaGetFArray(nas, L_NOCOPY);
#  284|       for (i = 0; i < n; i++)
#  285|            fas[hsize + i] = fa[i];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1089]
leptonica-1.87.0/src/numafunc2.c:287:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fas’
leptonica-1.87.0/src/numafunc2.c:258:8: branch_false: following ‘false’ branch (when ‘nas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:260:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:260:8: branch_false: following ‘false’ branch (when ‘size > 0’)...
leptonica-1.87.0/src/numafunc2.c:262:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:267:8: branch_false: following ‘false’ branch (when ‘size != 1’)...
leptonica-1.87.0/src/numafunc2.c:274:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:277:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:277:8: branch_false: following ‘false’ branch (when ‘fas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:277:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:279:17: branch_false: following ‘false’ branch (when ‘i >= hsize’)...
leptonica-1.87.0/src/numafunc2.c:281:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:281:25: branch_false: following ‘false’ branch (when ‘i >= len’)...
leptonica-1.87.0/src/numafunc2.c:283:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:284:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:287:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:287:11: throw: if ‘numaMakeConstant’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:287:11: danger: ‘fas’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  285|            fas[hsize + i] = fa[i];
#  286|   
#  287|->     nad = numaMakeConstant(0, n);
#  288|       numaCopyParameters(nad, nas);
#  289|       fad = numaGetFArray(nad, L_NOCOPY);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1090]
leptonica-1.87.0/src/numafunc2.c:288:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fas’
leptonica-1.87.0/src/numafunc2.c:258:8: branch_false: following ‘false’ branch (when ‘nas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:260:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:260:8: branch_false: following ‘false’ branch (when ‘size > 0’)...
leptonica-1.87.0/src/numafunc2.c:262:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:267:8: branch_false: following ‘false’ branch (when ‘size != 1’)...
leptonica-1.87.0/src/numafunc2.c:274:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:277:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:277:8: branch_false: following ‘false’ branch (when ‘fas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:277:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:279:17: branch_false: following ‘false’ branch (when ‘i >= hsize’)...
leptonica-1.87.0/src/numafunc2.c:281:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:281:25: branch_false: following ‘false’ branch (when ‘i >= len’)...
leptonica-1.87.0/src/numafunc2.c:283:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:284:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:287:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:288:5: throw: if ‘numaCopyParameters’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:288:5: danger: ‘fas’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  286|   
#  287|       nad = numaMakeConstant(0, n);
#  288|->     numaCopyParameters(nad, nas);
#  289|       fad = numaGetFArray(nad, L_NOCOPY);
#  290|       for (i = 0; i < n; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1091]
leptonica-1.87.0/src/numafunc2.c:289:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fas’
leptonica-1.87.0/src/numafunc2.c:258:8: branch_false: following ‘false’ branch (when ‘nas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:260:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:260:8: branch_false: following ‘false’ branch (when ‘size > 0’)...
leptonica-1.87.0/src/numafunc2.c:262:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:267:8: branch_false: following ‘false’ branch (when ‘size != 1’)...
leptonica-1.87.0/src/numafunc2.c:274:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:277:29: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:277:8: branch_false: following ‘false’ branch (when ‘fas’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:277:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:279:17: branch_false: following ‘false’ branch (when ‘i >= hsize’)...
leptonica-1.87.0/src/numafunc2.c:281:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:281:25: branch_false: following ‘false’ branch (when ‘i >= len’)...
leptonica-1.87.0/src/numafunc2.c:283:10: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:284:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:287:11: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:289:11: throw: if ‘numaGetFArray’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:289:11: danger: ‘fas’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  287|       nad = numaMakeConstant(0, n);
#  288|       numaCopyParameters(nad, nas);
#  289|->     fad = numaGetFArray(nad, L_NOCOPY);
#  290|       for (i = 0; i < n; i++) {
#  291|           maxval = -1.0e37f;  /* start small */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1092]
leptonica-1.87.0/src/numafunc2.c:458:16: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2337:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2340:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2340:9: call_function: calling ‘numaSimpleStats’ from ‘grayInterHistogramStats’
#  456|           return ERROR_INT("nothing requested", __func__, 1);
#  457|       if (!na)
#  458|->         return ERROR_INT("na not defined", __func__, 1);
#  459|       if ((n = numaGetCount(na)) == 0)
#  460|           return ERROR_INT("na is empty", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1093]
leptonica-1.87.0/src/numafunc2.c:459:14: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2337:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2340:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2340:9: call_function: calling ‘numaSimpleStats’ from ‘grayInterHistogramStats’
#  457|       if (!na)
#  458|           return ERROR_INT("na not defined", __func__, 1);
#  459|->     if ((n = numaGetCount(na)) == 0)
#  460|           return ERROR_INT("na is empty", __func__, 1);
#  461|       first = L_MAX(0, first);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1094]
leptonica-1.87.0/src/numafunc2.c:460:16: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2337:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2340:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2340:9: call_function: calling ‘numaSimpleStats’ from ‘grayInterHistogramStats’
#  458|           return ERROR_INT("na not defined", __func__, 1);
#  459|       if ((n = numaGetCount(na)) == 0)
#  460|->         return ERROR_INT("na is empty", __func__, 1);
#  461|       first = L_MAX(0, first);
#  462|       if (last < 0) last = n - 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1095]
leptonica-1.87.0/src/numafunc2.c:464:16: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2337:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2340:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2340:9: call_function: calling ‘numaSimpleStats’ from ‘grayInterHistogramStats’
#  462|       if (last < 0) last = n - 1;
#  463|       if (first >= n)
#  464|->         return ERROR_INT("invalid first", __func__, 1);
#  465|       if (last >= n) {
#  466|           L_WARNING("last = %d is beyond max index = %d; adjusting\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1096]
leptonica-1.87.0/src/numafunc2.c:466:9: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2337:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2340:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2340:9: call_function: calling ‘numaSimpleStats’ from ‘grayInterHistogramStats’
#  464|           return ERROR_INT("invalid first", __func__, 1);
#  465|       if (last >= n) {
#  466|->         L_WARNING("last = %d is beyond max index = %d; adjusting\n",
#  467|                     __func__, last, n - 1);
#  468|           last = n - 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1097]
leptonica-1.87.0/src/numafunc2.c:475:9: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2337:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2340:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2340:9: call_function: calling ‘numaSimpleStats’ from ‘grayInterHistogramStats’
#  473|       sum = sumsq = 0.0;
#  474|       for (i = first; i <= last; i++) {
#  475|->         numaGetFValue(na, i, &val);
#  476|           sum += val;
#  477|           sumsq += val * val;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1098]
leptonica-1.87.0/src/numafunc2.c:583:24: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2310:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2308:24: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc2.c:2325:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2326:15: call_function: calling ‘numaWindowedMean’ from ‘grayInterHistogramStats’
#  581|   
#  582|       if (!nas)
#  583|->         return (NUMA *)ERROR_PTR("nas not defined", __func__, NULL);
#  584|       n = numaGetCount(nas);
#  585|       width = 2 * wc + 1;  /* filter width */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1099]
leptonica-1.87.0/src/numafunc2.c:584:9: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2310:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2308:24: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc2.c:2325:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2326:15: call_function: calling ‘numaWindowedMean’ from ‘grayInterHistogramStats’
#  582|       if (!nas)
#  583|           return (NUMA *)ERROR_PTR("nas not defined", __func__, NULL);
#  584|->     n = numaGetCount(nas);
#  585|       width = 2 * wc + 1;  /* filter width */
#  586|       if (width > n)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1100]
leptonica-1.87.0/src/numafunc2.c:587:9: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2310:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2308:24: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc2.c:2325:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2326:15: call_function: calling ‘numaWindowedMean’ from ‘grayInterHistogramStats’
#  585|       width = 2 * wc + 1;  /* filter width */
#  586|       if (width > n)
#  587|->         L_WARNING("filter wider than input array!\n", __func__);
#  588|   
#  589|       na1 = numaAddSpecifiedBorder(nas, wc, wc, L_MIRRORED_BORDER);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1101]
leptonica-1.87.0/src/numafunc2.c:589:11: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2310:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2308:24: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc2.c:2325:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2326:15: call_function: calling ‘numaWindowedMean’ from ‘grayInterHistogramStats’
#  587|           L_WARNING("filter wider than input array!\n", __func__);
#  588|   
#  589|->     na1 = numaAddSpecifiedBorder(nas, wc, wc, L_MIRRORED_BORDER);
#  590|       n1 = n + 2 * wc;
#  591|       fa1 = numaGetFArray(na1, L_NOCOPY);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1102]
leptonica-1.87.0/src/numafunc2.c:591:11: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2310:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2308:24: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc2.c:2325:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2326:15: call_function: calling ‘numaWindowedMean’ from ‘grayInterHistogramStats’
#  589|       na1 = numaAddSpecifiedBorder(nas, wc, wc, L_MIRRORED_BORDER);
#  590|       n1 = n + 2 * wc;
#  591|->     fa1 = numaGetFArray(na1, L_NOCOPY);
#  592|       nad = numaMakeConstant(0, n);
#  593|       fad = numaGetFArray(nad, L_NOCOPY);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1103]
leptonica-1.87.0/src/numafunc2.c:592:11: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2310:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2308:24: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc2.c:2325:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2326:15: call_function: calling ‘numaWindowedMean’ from ‘grayInterHistogramStats’
#  590|       n1 = n + 2 * wc;
#  591|       fa1 = numaGetFArray(na1, L_NOCOPY);
#  592|->     nad = numaMakeConstant(0, n);
#  593|       fad = numaGetFArray(nad, L_NOCOPY);
#  594|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1104]
leptonica-1.87.0/src/numafunc2.c:593:11: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2310:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2308:24: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc2.c:2325:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2326:15: call_function: calling ‘numaWindowedMean’ from ‘grayInterHistogramStats’
#  591|       fa1 = numaGetFArray(na1, L_NOCOPY);
#  592|       nad = numaMakeConstant(0, n);
#  593|->     fad = numaGetFArray(nad, L_NOCOPY);
#  594|   
#  595|           /* Make sum array; note the indexing */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1105]
leptonica-1.87.0/src/numafunc2.c:597:9: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2310:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2308:24: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc2.c:2325:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2326:15: call_function: calling ‘numaWindowedMean’ from ‘grayInterHistogramStats’
#  595|           /* Make sum array; note the indexing */
#  596|       if ((suma = (l_float32 *)LEPT_CALLOC(n1 + 1, sizeof(l_float32))) == NULL) {
#  597|->         numaDestroy(&na1);
#  598|           numaDestroy(&nad);
#  599|           return (NUMA *)ERROR_PTR("suma not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1106]
leptonica-1.87.0/src/numafunc2.c:2325:15: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_false: following ‘false’ branch (when ‘pnam’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_false: following ‘false’ branch (when ‘pnav’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2310:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2308:24: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_false: following ‘false’ branch (when ‘pnam’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_false: following ‘false’ branch (when ‘pnav’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/numafunc2.c:2325:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2325:15: throw: if ‘numaaGetNuma’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:2325:15: danger: ‘arrays’ leaks here; was allocated at [(23)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/22)
# 2323|       arrays = (l_float32 **)LEPT_CALLOC(n, sizeof(l_float32 *));
# 2324|       for (i = 0; i < n; i++) {
# 2325|->         na1 = numaaGetNuma(naa, i, L_CLONE);
# 2326|           na2 = numaWindowedMean(na1, wc);
# 2327|           na3 = numaNormalizeHistogram(na2, 10000.);

Error: CPPCHECK_WARNING (CWE-476): [#def1107]
leptonica-1.87.0/src/numafunc2.c:2328: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: arrays
# 2326|           na2 = numaWindowedMean(na1, wc);
# 2327|           na3 = numaNormalizeHistogram(na2, 10000.);
# 2328|->         arrays[i] = numaGetFArray(na3, L_COPY);
# 2329|           numaDestroy(&na1);
# 2330|           numaDestroy(&na2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1108]
leptonica-1.87.0/src/numafunc2.c:2336:15: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_false: following ‘false’ branch (when ‘pnam’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_false: following ‘false’ branch (when ‘pnav’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_false: following ‘false’ branch (when ‘pnam’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_false: following ‘false’ branch (when ‘pnav’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2336:15: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:2336:15: danger: ‘arrays’ leaks here; was allocated at [(21)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/20)
# 2334|           /* Get stats between histograms */
# 2335|       for (j = 0; j < 256; j++) {
# 2336|->         na4 = numaCreate(n);
# 2337|           for (i = 0; i < n; i++) {
# 2338|               numaAddNumber(na4, arrays[i][j]);

Error: CPPCHECK_WARNING (CWE-476): [#def1109]
leptonica-1.87.0/src/numafunc2.c:2338: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: arrays
# 2336|           na4 = numaCreate(n);
# 2337|           for (i = 0; i < n; i++) {
# 2338|->             numaAddNumber(na4, arrays[i][j]);
# 2339|           }
# 2340|           numaSimpleStats(na4, 0, -1, &mean, &var, &rvar);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1110]
leptonica-1.87.0/src/numafunc2.c:2341:19: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2337:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2340:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2340:9: call_function: calling ‘numaSimpleStats’ from ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2340:9: return_function: returning to ‘grayInterHistogramStats’ from ‘numaSimpleStats’
leptonica-1.87.0/src/numafunc2.c:2341:12: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2341:19: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2341:19: throw: if ‘numaAddNumber’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:2341:19: danger: ‘arrays’ leaks here; was allocated at [(22)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/21)
# 2339|           }
# 2340|           numaSimpleStats(na4, 0, -1, &mean, &var, &rvar);
# 2341|->         if (pnam) numaAddNumber(*pnam, mean);
# 2342|           if (pnams) numaAddNumber(*pnams, mean * mean);
# 2343|           if (pnav) numaAddNumber(*pnav, var);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1111]
leptonica-1.87.0/src/numafunc2.c:2342:20: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2337:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2340:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2340:9: call_function: calling ‘numaSimpleStats’ from ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2340:9: return_function: returning to ‘grayInterHistogramStats’ from ‘numaSimpleStats’
leptonica-1.87.0/src/numafunc2.c:2341:12: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2341:19: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2342:12: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2342:20: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2342:20: throw: if ‘numaAddNumber’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:2342:20: danger: ‘arrays’ leaks here; was allocated at [(22)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/21)
# 2340|           numaSimpleStats(na4, 0, -1, &mean, &var, &rvar);
# 2341|           if (pnam) numaAddNumber(*pnam, mean);
# 2342|->         if (pnams) numaAddNumber(*pnams, mean * mean);
# 2343|           if (pnav) numaAddNumber(*pnav, var);
# 2344|           if (pnarv) numaAddNumber(*pnarv, rvar);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1112]
leptonica-1.87.0/src/numafunc2.c:2343:19: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2337:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2340:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2340:9: call_function: calling ‘numaSimpleStats’ from ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2340:9: return_function: returning to ‘grayInterHistogramStats’ from ‘numaSimpleStats’
leptonica-1.87.0/src/numafunc2.c:2341:12: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2341:19: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2342:12: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2342:20: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2343:12: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2343:19: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2343:19: throw: if ‘numaAddNumber’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:2343:19: danger: ‘arrays’ leaks here; was allocated at [(22)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/21)
# 2341|           if (pnam) numaAddNumber(*pnam, mean);
# 2342|           if (pnams) numaAddNumber(*pnams, mean * mean);
# 2343|->         if (pnav) numaAddNumber(*pnav, var);
# 2344|           if (pnarv) numaAddNumber(*pnarv, rvar);
# 2345|           numaDestroy(&na4);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1113]
leptonica-1.87.0/src/numafunc2.c:2345:9: warning[-Wanalyzer-malloc-leak]: leak of ‘arrays’
leptonica-1.87.0/src/numafunc2.c:2287:1: enter_function: entry to ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2299:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2299:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2300:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2300:16: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2301:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2301:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2302:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2303:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2303:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2305:8: branch_false: following ‘false’ branch (when ‘naa’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2307:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2316:8: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2316:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2317:8: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2317:25: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2318:8: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2318:23: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2319:8: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2323:28: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2323:28: acquire_memory: allocated here
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2324:17: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2335:17: branch_true: following ‘true’ branch (when ‘j != 256’)...
leptonica-1.87.0/src/numafunc2.c:2336:15: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2337:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/numafunc2.c:2340:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2340:9: call_function: calling ‘numaSimpleStats’ from ‘grayInterHistogramStats’
leptonica-1.87.0/src/numafunc2.c:2340:9: return_function: returning to ‘grayInterHistogramStats’ from ‘numaSimpleStats’
leptonica-1.87.0/src/numafunc2.c:2341:12: branch_true: following ‘true’ branch (when ‘pnam’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2341:19: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2342:12: branch_true: following ‘true’ branch (when ‘pnams’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2342:20: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2343:12: branch_true: following ‘true’ branch (when ‘pnav’ is non-NULL)...
leptonica-1.87.0/src/numafunc2.c:2343:19: branch_true: ...to here
leptonica-1.87.0/src/numafunc2.c:2344:12: branch_false: following ‘false’ branch (when ‘pnarv’ is NULL)...
leptonica-1.87.0/src/numafunc2.c:2345:9: branch_false: ...to here
leptonica-1.87.0/src/numafunc2.c:2345:9: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/numafunc2.c:2345:9: danger: ‘arrays’ leaks here; was allocated at [(22)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/21)
# 2343|           if (pnav) numaAddNumber(*pnav, var);
# 2344|           if (pnarv) numaAddNumber(*pnarv, rvar);
# 2345|->         numaDestroy(&na4);
# 2346|       }
# 2347|   

Error: CPPCHECK_WARNING (CWE-476): [#def1114]
leptonica-1.87.0/src/pageseg.c:2617: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lowestfg
# 2615|       lowestfg = (l_int32 *)LEPT_CALLOC(w, sizeof(l_int32));
# 2616|       for (i = 0; i < w; i++)
# 2617|->         lowestfg[i] = -1;
# 2618|   
# 2619|           /* The combination (val ^ polarity) is the color for which we

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1115]
leptonica-1.87.0/src/pageseg.c:2617:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_false: following ‘false’ branch (when ‘ppixdb’ is NULL)...
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pageseg.c:2616:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pageseg.c:2617:17: branch_true: ...to here
leptonica-1.87.0/src/pageseg.c:2617:9: danger: ‘lowestfg + (long unsigned int)i * 4’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
# 2615|       lowestfg = (l_int32 *)LEPT_CALLOC(w, sizeof(l_int32));
# 2616|       for (i = 0; i < w; i++)
# 2617|->         lowestfg[i] = -1;
# 2618|   
# 2619|           /* The combination (val ^ polarity) is the color for which we

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1116]
leptonica-1.87.0/src/pageseg.c:2622:12: warning[-Wanalyzer-malloc-leak]: leak of ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_false: following ‘false’ branch (when ‘ppixdb’ is NULL)...
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: allocated here
leptonica-1.87.0/src/pageseg.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2622:12: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2622:12: throw: if ‘pixCreate’ throws an exception...
leptonica-1.87.0/src/pageseg.c:2622:12: danger: ‘lowestfg’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
# 2620|            * are searching for the maximum rectangle.  For polarity == 0,
# 2621|            * we search in the bg (white). */
# 2622|->     pixw = pixCreate(w, h, 32);  /* stores width */
# 2623|       pixh = pixCreate(w, h, 32);  /* stores height */
# 2624|       linew = (l_uint32 **)pixGetLinePtrs(pixw, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1117]
leptonica-1.87.0/src/pageseg.c:2623:12: warning[-Wanalyzer-malloc-leak]: leak of ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_false: following ‘false’ branch (when ‘ppixdb’ is NULL)...
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: allocated here
leptonica-1.87.0/src/pageseg.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2622:12: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2623:12: throw: if ‘pixCreate’ throws an exception...
leptonica-1.87.0/src/pageseg.c:2623:12: danger: ‘lowestfg’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
# 2621|            * we search in the bg (white). */
# 2622|       pixw = pixCreate(w, h, 32);  /* stores width */
# 2623|->     pixh = pixCreate(w, h, 32);  /* stores height */
# 2624|       linew = (l_uint32 **)pixGetLinePtrs(pixw, NULL);
# 2625|       lineh = (l_uint32 **)pixGetLinePtrs(pixh, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1118]
leptonica-1.87.0/src/pageseg.c:2624:26: warning[-Wanalyzer-malloc-leak]: leak of ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_false: following ‘false’ branch (when ‘ppixdb’ is NULL)...
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: allocated here
leptonica-1.87.0/src/pageseg.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2622:12: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2624:26: throw: if ‘pixGetLinePtrs’ throws an exception...
leptonica-1.87.0/src/pageseg.c:2624:26: danger: ‘lowestfg’ leaks here; was allocated at [(11)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/10)
# 2622|       pixw = pixCreate(w, h, 32);  /* stores width */
# 2623|       pixh = pixCreate(w, h, 32);  /* stores height */
# 2624|->     linew = (l_uint32 **)pixGetLinePtrs(pixw, NULL);
# 2625|       lineh = (l_uint32 **)pixGetLinePtrs(pixh, NULL);
# 2626|       datas = pixGetData(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1119]
leptonica-1.87.0/src/pageseg.c:2625:26: warning[-Wanalyzer-malloc-leak]: leak of ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_false: following ‘false’ branch (when ‘ppixdb’ is NULL)...
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: allocated here
leptonica-1.87.0/src/pageseg.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2622:12: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2625:26: throw: if ‘pixGetLinePtrs’ throws an exception...
leptonica-1.87.0/src/pageseg.c:2625:26: danger: ‘lowestfg’ leaks here; was allocated at [(11)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/10)
# 2623|       pixh = pixCreate(w, h, 32);  /* stores height */
# 2624|       linew = (l_uint32 **)pixGetLinePtrs(pixw, NULL);
# 2625|->     lineh = (l_uint32 **)pixGetLinePtrs(pixh, NULL);
# 2626|       datas = pixGetData(pixs);
# 2627|       wpls = pixGetWpl(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1120]
leptonica-1.87.0/src/pageseg.c:2626:13: warning[-Wanalyzer-malloc-leak]: leak of ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_false: following ‘false’ branch (when ‘ppixdb’ is NULL)...
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: allocated here
leptonica-1.87.0/src/pageseg.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2622:12: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2626:13: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/pageseg.c:2626:13: danger: ‘lowestfg’ leaks here; was allocated at [(11)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/10)
# 2624|       linew = (l_uint32 **)pixGetLinePtrs(pixw, NULL);
# 2625|       lineh = (l_uint32 **)pixGetLinePtrs(pixh, NULL);
# 2626|->     datas = pixGetData(pixs);
# 2627|       wpls = pixGetWpl(pixs);
# 2628|       maxarea = xmax = ymax = wmax = hmax = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1121]
leptonica-1.87.0/src/pageseg.c:2627:12: warning[-Wanalyzer-malloc-leak]: leak of ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_false: following ‘false’ branch (when ‘ppixdb’ is NULL)...
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: allocated here
leptonica-1.87.0/src/pageseg.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2622:12: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2627:12: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/pageseg.c:2627:12: danger: ‘lowestfg’ leaks here; was allocated at [(11)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/10)
# 2625|       lineh = (l_uint32 **)pixGetLinePtrs(pixh, NULL);
# 2626|       datas = pixGetData(pixs);
# 2627|->     wpls = pixGetWpl(pixs);
# 2628|       maxarea = xmax = ymax = wmax = hmax = 0;
# 2629|       for (i = 0; i < h; i++) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1122]
leptonica-1.87.0/src/pageseg.c:2668:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_false: following ‘false’ branch (when ‘ppixdb’ is NULL)...
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pageseg.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2622:12: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2629:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pageseg.c:2630:25: branch_true: ...to here
leptonica-1.87.0/src/pageseg.c:2632:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pageseg.c:2633:19: branch_true: ...to here
leptonica-1.87.0/src/pageseg.c:2634:16: branch_false: following ‘false’ branch (when ‘polarity != val’)...
leptonica-1.87.0/src/pageseg.c:2668:25: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2668:17: danger: ‘lowestfg + (long unsigned int)j * 4’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/10)
# 2666|               } else {  /* fg (1) if polarity == 0; bg (0) if polarity == 1 */
# 2667|                   prevfg = j;
# 2668|->                 lowestfg[j] = i;
# 2669|                   wp = hp = 0;
# 2670|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1123]
leptonica-1.87.0/src/pageseg.c:2684:11: warning[-Wanalyzer-malloc-leak]: leak of ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_false: following ‘false’ branch (when ‘ppixdb’ is NULL)...
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: allocated here
leptonica-1.87.0/src/pageseg.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2622:12: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2684:11: throw: if ‘boxCreate’ throws an exception...
leptonica-1.87.0/src/pageseg.c:2684:11: danger: ‘lowestfg’ leaks here; was allocated at [(11)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/10)
# 2682|   
# 2683|           /* Translate from LR corner to Box coords (UL corner, w, h) */
# 2684|->     box = boxCreate(xmax - wmax + 1, ymax - hmax + 1, wmax, hmax);
# 2685|       *pbox = box;
# 2686|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1124]
leptonica-1.87.0/src/pageseg.c:2688:19: warning[-Wanalyzer-malloc-leak]: leak of ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_true: following ‘true’ branch (when ‘ppixdb’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2602:17: branch_true: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: allocated here
leptonica-1.87.0/src/pageseg.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2622:12: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2687:8: branch_true: following ‘true’ branch (when ‘ppixdb’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2688:19: branch_true: ...to here
leptonica-1.87.0/src/pageseg.c:2688:19: throw: if ‘pixConvertTo8’ throws an exception...
leptonica-1.87.0/src/pageseg.c:2688:19: danger: ‘lowestfg’ leaks here; was allocated at [(11)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/10)
# 2686|   
# 2687|       if (ppixdb) {
# 2688|->         *ppixdb = pixConvertTo8(pixs, TRUE);
# 2689|           pixRenderHashBoxArb(*ppixdb, box, 6, 2, L_NEG_SLOPE_LINE, 1, 255, 0, 0);
# 2690|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1125]
leptonica-1.87.0/src/pageseg.c:2689:9: warning[-Wanalyzer-malloc-leak]: leak of ‘lowestfg’
leptonica-1.87.0/src/pageseg.c:2602:8: branch_true: following ‘true’ branch (when ‘ppixdb’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2602:17: branch_true: ...to here
leptonica-1.87.0/src/pageseg.c:2603:8: branch_false: following ‘false’ branch (when ‘pbox’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2605:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2606:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2608:5: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2609:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2611:9: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2611:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2615:27: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2615:27: acquire_memory: allocated here
leptonica-1.87.0/src/pageseg.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pageseg.c:2622:12: branch_false: ...to here
leptonica-1.87.0/src/pageseg.c:2687:8: branch_true: following ‘true’ branch (when ‘ppixdb’ is non-NULL)...
leptonica-1.87.0/src/pageseg.c:2688:19: branch_true: ...to here
leptonica-1.87.0/src/pageseg.c:2689:9: throw: if ‘pixRenderHashBoxArb’ throws an exception...
leptonica-1.87.0/src/pageseg.c:2689:9: danger: ‘lowestfg’ leaks here; was allocated at [(11)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/10)
# 2687|       if (ppixdb) {
# 2688|           *ppixdb = pixConvertTo8(pixs, TRUE);
# 2689|->         pixRenderHashBoxArb(*ppixdb, box, 6, 2, L_NEG_SLOPE_LINE, 1, 255, 0, 0);
# 2690|       }
# 2691|   

Error: COMPILER_WARNING (CWE-457): [#def1126]
leptonica-1.87.0/src/parseprotos.c:528:23: warning[-Wmaybe-uninitialized]: ‘start’ may be used uninitialized
#  528 |     for (i = start; i < stop; i++) {
#      |                     ~~^~~~~~
leptonica-1.87.0/src/parseprotos.c: scope_hint: In function ‘parseForProtos’
leptonica-1.87.0/src/parseprotos.c:154:10: note: ‘start’ was declared here
#  154 | l_int32  start, next, stop, charindex, found;
#      |          ^~~~~
#  526|   
#  527|       sap = sarrayCreate(0);
#  528|->     for (i = start; i < stop; i++) {
#  529|           str = sarrayGetString(sa, i, L_COPY);
#  530|           sarrayAddString(sap, str, L_INSERT);

Error: COMPILER_WARNING (CWE-457): [#def1127]
leptonica-1.87.0/src/parseprotos.c:528:23: warning[-Wmaybe-uninitialized]: ‘stop’ may be used uninitialized
#  528 |     for (i = start; i < stop; i++) {
#      |                     ~~^~~~~~
leptonica-1.87.0/src/parseprotos.c: scope_hint: In function ‘parseForProtos’
leptonica-1.87.0/src/parseprotos.c:154:23: note: ‘stop’ was declared here
#  154 | l_int32  start, next, stop, charindex, found;
#      |                       ^~~~
#  526|   
#  527|       sap = sarrayCreate(0);
#  528|->     for (i = start; i < stop; i++) {
#  529|           str = sarrayGetString(sa, i, L_COPY);
#  530|           sarrayAddString(sap, str, L_INSERT);

Error: COMPILER_WARNING (CWE-457): [#def1128]
leptonica-1.87.0/src/parseprotos.c:533:19: warning[-Wmaybe-uninitialized]: ‘charindex’ may be used uninitialized
#  533 |     str[charindex + 1] = '\0';
#      |         ~~~~~~~~~~^~~
leptonica-1.87.0/src/parseprotos.c: scope_hint: In function ‘parseForProtos’
leptonica-1.87.0/src/parseprotos.c:154:29: note: ‘charindex’ was declared here
#  154 | l_int32  start, next, stop, charindex, found;
#      |                             ^~~~~~~~~
#  531|       }
#  532|       str = sarrayGetString(sa, stop, L_COPY);
#  533|->     str[charindex + 1] = '\0';
#  534|       newstr = stringJoin(str, ";");
#  535|       sarrayAddString(sap, newstr, L_INSERT);

Error: CPPCHECK_WARNING (CWE-476): [#def1129]
leptonica-1.87.0/src/partify.c:147: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixaca
#  145|       pixaca = (PIXAC **)LEPT_CALLOC(nparts, sizeof(PIXAC *));
#  146|       for (i = 0; i < nparts; i++)
#  147|->         pixaca[i] = pixacompCreate(0);
#  148|   
#  149|           /* Process each page */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1130]
leptonica-1.87.0/src/partify.c:147:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/partify.c:146:17: branch_true: following ‘true’ branch (when ‘nparts > i’)...
leptonica-1.87.0/src/partify.c:147:15: branch_true: ...to here
leptonica-1.87.0/src/partify.c:147:9: danger: ‘pixaca + (long unsigned int)i * 8’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  145|       pixaca = (PIXAC **)LEPT_CALLOC(nparts, sizeof(PIXAC *));
#  146|       for (i = 0; i < nparts; i++)
#  147|->         pixaca[i] = pixacompCreate(0);
#  148|   
#  149|           /* Process each page */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1131]
leptonica-1.87.0/src/partify.c:147:21: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_true: following ‘true’ branch (when ‘nparts > i’)...
leptonica-1.87.0/src/partify.c:147:15: branch_true: ...to here
leptonica-1.87.0/src/partify.c:147:21: throw: if ‘pixacompCreate’ throws an exception...
leptonica-1.87.0/src/partify.c:147:21: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  145|       pixaca = (PIXAC **)LEPT_CALLOC(nparts, sizeof(PIXAC *));
#  146|       for (i = 0; i < nparts; i++)
#  147|->         pixaca[i] = pixacompCreate(0);
#  148|   
#  149|           /* Process each page */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1132]
leptonica-1.87.0/src/partify.c:151:11: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:151:11: throw: if ‘bmfCreate’ throws an exception...
leptonica-1.87.0/src/partify.c:151:11: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  149|           /* Process each page */
#  150|       line = 1;
#  151|->     bmf = bmfCreate(NULL, 10);
#  152|       for (pageno = 0; pageno < npage; pageno++) {
#  153|           if ((pix1 = pixacompGetPix(pixac, pageno)) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1133]
leptonica-1.87.0/src/partify.c:153:21: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:153:21: throw: if ‘pixacompGetPix’ throws an exception...
leptonica-1.87.0/src/partify.c:153:21: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  151|       bmf = bmfCreate(NULL, 10);
#  152|       for (pageno = 0; pageno < npage; pageno++) {
#  153|->         if ((pix1 = pixacompGetPix(pixac, pageno)) == NULL) {
#  154|               L_ERROR("pix for page %d not found\n", __func__, pageno);
#  155|               continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1134]
leptonica-1.87.0/src/partify.c:154:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:153:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:154:13: branch_true: ...to here
leptonica-1.87.0/src/partify.c:154:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:154:13: branch_true: ...to here
leptonica-1.87.0/src/partify.c:154:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/partify.c:154:13: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  152|       for (pageno = 0; pageno < npage; pageno++) {
#  153|           if ((pix1 = pixacompGetPix(pixac, pageno)) == NULL) {
#  154|->             L_ERROR("pix for page %d not found\n", __func__, pageno);
#  155|               continue;
#  156|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1135]
leptonica-1.87.0/src/partify.c:159:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:159:15: throw: if ‘pixGetXRes’ throws an exception...
leptonica-1.87.0/src/partify.c:159:15: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
#  157|   
#  158|               /* Scale, binarize and deskew */
#  159|->         res = pixGetXRes(pix1);
#  160|           if (res == 0 || res == 300 || res > 600) {
#  161|               pix2 = pixClone(pix1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1136]
leptonica-1.87.0/src/partify.c:161:20: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:161:20: throw: if ‘pixClone’ throws an exception...
leptonica-1.87.0/src/partify.c:161:20: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/6)
#  159|           res = pixGetXRes(pix1);
#  160|           if (res == 0 || res == 300 || res > 600) {
#  161|->             pix2 = pixClone(pix1);
#  162|           } else {
#  163|               factor = 300.0f / (l_float32)res;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1137]
leptonica-1.87.0/src/partify.c:165:17: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:160:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:164:16: branch_true: following ‘true’ branch (when ‘factor > 3.0e+0’)...
leptonica-1.87.0/src/partify.c:165:17: branch_true: ...to here
leptonica-1.87.0/src/partify.c:165:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:165:17: branch_true: ...to here
leptonica-1.87.0/src/partify.c:165:17: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/partify.c:165:17: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/6)
#  163|               factor = 300.0f / (l_float32)res;
#  164|               if (factor > 3)
#  165|->                 L_WARNING("resolution is very low\n", __func__);
#  166|               pix2 = pixScale(pix1, factor, factor);
#  167|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1138]
leptonica-1.87.0/src/partify.c:166:20: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:160:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:166:20: throw: if ‘pixScale’ throws an exception...
leptonica-1.87.0/src/partify.c:166:20: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/6)
#  164|               if (factor > 3)
#  165|                   L_WARNING("resolution is very low\n", __func__);
#  166|->             pix2 = pixScale(pix1, factor, factor);
#  167|           }
#  168|           pix3 = pixConvertTo1Adaptive(pix2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1139]
leptonica-1.87.0/src/partify.c:168:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:168:16: throw: if ‘pixConvertTo1Adaptive’ throws an exception...
leptonica-1.87.0/src/partify.c:168:16: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/6)
#  166|               pix2 = pixScale(pix1, factor, factor);
#  167|           }
#  168|->         pix3 = pixConvertTo1Adaptive(pix2);
#  169|           pix4 = pixDeskew(pix3, 0);
#  170|           pixDestroy(&pix1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1140]
leptonica-1.87.0/src/partify.c:169:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:169:16: throw: if ‘pixDeskew’ throws an exception...
leptonica-1.87.0/src/partify.c:169:16: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/6)
#  167|           }
#  168|           pix3 = pixConvertTo1Adaptive(pix2);
#  169|->         pix4 = pixDeskew(pix3, 0);
#  170|           pixDestroy(&pix1);
#  171|           pixDestroy(&pix2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1141]
leptonica-1.87.0/src/partify.c:170:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:170:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/partify.c:170:9: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/6)
#  168|           pix3 = pixConvertTo1Adaptive(pix2);
#  169|           pix4 = pixDeskew(pix3, 0);
#  170|->         pixDestroy(&pix1);
#  171|           pixDestroy(&pix2);
#  172|           pixDestroy(&pix3);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1142]
leptonica-1.87.0/src/partify.c:171:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:171:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/partify.c:171:9: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/6)
#  169|           pix4 = pixDeskew(pix3, 0);
#  170|           pixDestroy(&pix1);
#  171|->         pixDestroy(&pix2);
#  172|           pixDestroy(&pix3);
#  173|           if (!pix4) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1143]
leptonica-1.87.0/src/partify.c:172:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:172:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/partify.c:172:9: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/6)
#  170|           pixDestroy(&pix1);
#  171|           pixDestroy(&pix2);
#  172|->         pixDestroy(&pix3);
#  173|           if (!pix4) {
#  174|               L_ERROR("pix for page %d not deskewed\n", __func__, pageno);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1144]
leptonica-1.87.0/src/partify.c:174:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:174:13: branch_true: ...to here
leptonica-1.87.0/src/partify.c:174:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:174:13: branch_true: ...to here
leptonica-1.87.0/src/partify.c:174:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/partify.c:174:13: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/6)
#  172|           pixDestroy(&pix3);
#  173|           if (!pix4) {
#  174|->             L_ERROR("pix for page %d not deskewed\n", __func__, pageno);
#  175|               continue;
#  176|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1145]
leptonica-1.87.0/src/partify.c:177:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:177:16: branch_false: ...to here
leptonica-1.87.0/src/partify.c:177:16: throw: if ‘pixClone’ throws an exception...
leptonica-1.87.0/src/partify.c:177:16: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/6)
#  175|               continue;
#  176|           }
#  177|->         pix1 = pixClone(pix4);  /* rename */
#  178|           pixDestroy(&pix4);
#  179|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1146]
leptonica-1.87.0/src/partify.c:178:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:177:16: branch_false: ...to here
leptonica-1.87.0/src/partify.c:178:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/partify.c:178:9: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/6)
#  176|           }
#  177|           pix1 = pixClone(pix4);  /* rename */
#  178|->         pixDestroy(&pix4);
#  179|   
#  180|               /* Find the stave sets at 4x reduction */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1147]
leptonica-1.87.0/src/partify.c:230:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_true: following ‘true’ branch (when ‘nparts > i’)...
leptonica-1.87.0/src/partify.c:147:15: branch_true: ...to here
leptonica-1.87.0/src/partify.c:228:17: branch_true: following ‘true’ branch (when ‘nparts > i’)...
leptonica-1.87.0/src/partify.c:229:9: branch_true: ...to here
leptonica-1.87.0/src/partify.c:230:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:230:9: branch_true: ...to here
leptonica-1.87.0/src/partify.c:230:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/partify.c:230:9: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/6)
#  228|       for (i = 0; i < nparts; i++) {
#  229|           snprintf(buf, sizeof(buf), "%s-%d.pdf", outroot, i);
#  230|->         L_INFO("writing part %d: %s\n", __func__, i, buf);
#  231|           pixacompConvertToPdf(pixaca[i], 300, 1.0, L_G4_ENCODE, 0, NULL, buf);
#  232|           pixacompDestroy(&pixaca[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1148]
leptonica-1.87.0/src/partify.c:231:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_true: following ‘true’ branch (when ‘nparts > i’)...
leptonica-1.87.0/src/partify.c:147:15: branch_true: ...to here
leptonica-1.87.0/src/partify.c:228:17: branch_true: following ‘true’ branch (when ‘nparts > i’)...
leptonica-1.87.0/src/partify.c:229:9: branch_true: ...to here
leptonica-1.87.0/src/partify.c:231:9: throw: if ‘pixacompConvertToPdf’ throws an exception...
leptonica-1.87.0/src/partify.c:231:9: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/6)
#  229|           snprintf(buf, sizeof(buf), "%s-%d.pdf", outroot, i);
#  230|           L_INFO("writing part %d: %s\n", __func__, i, buf);
#  231|->         pixacompConvertToPdf(pixaca[i], 300, 1.0, L_G4_ENCODE, 0, NULL, buf);
#  232|           pixacompDestroy(&pixaca[i]);
#  233|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1149]
leptonica-1.87.0/src/partify.c:232:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_true: following ‘true’ branch (when ‘nparts > i’)...
leptonica-1.87.0/src/partify.c:147:15: branch_true: ...to here
leptonica-1.87.0/src/partify.c:228:17: branch_true: following ‘true’ branch (when ‘nparts > i’)...
leptonica-1.87.0/src/partify.c:229:9: branch_true: ...to here
leptonica-1.87.0/src/partify.c:232:9: throw: if ‘pixacompDestroy’ throws an exception...
leptonica-1.87.0/src/partify.c:232:9: danger: ‘pixaca’ leaks here; was allocated at [(7)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/6)
#  230|           L_INFO("writing part %d: %s\n", __func__, i, buf);
#  231|           pixacompConvertToPdf(pixaca[i], 300, 1.0, L_G4_ENCODE, 0, NULL, buf);
#  232|->         pixacompDestroy(&pixaca[i]);
#  233|       }
#  234|       LEPT_FREE(pixaca);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1150]
leptonica-1.87.0/src/partify.c:257:24: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:121:1: enter_function: entry to ‘partifyPixac’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:177:16: branch_false: ...to here
leptonica-1.87.0/src/partify.c:181:17: call_function: calling ‘pixLocateStaveSets’ from ‘partifyPixac’
#  255|   
#  256|       if (!pixs)
#  257|->         return (BOXA *)ERROR_PTR("pixs not defined", __func__, NULL);
#  258|   
#  259|           /* Find the stave sets at 4x reduction */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1151]
leptonica-1.87.0/src/partify.c:260:12: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:121:1: enter_function: entry to ‘partifyPixac’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:177:16: branch_false: ...to here
leptonica-1.87.0/src/partify.c:181:17: call_function: calling ‘pixLocateStaveSets’ from ‘partifyPixac’
#  258|   
#  259|           /* Find the stave sets at 4x reduction */
#  260|->     pix1 = pixMorphSequence(pixs, "r11", 0);
#  261|       boxa1 = pixConnCompBB(pix1, 8);
#  262|       boxa2 = boxaSelectByArea(boxa1, 15000, L_SELECT_IF_GT, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1152]
leptonica-1.87.0/src/partify.c:261:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:121:1: enter_function: entry to ‘partifyPixac’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:177:16: branch_false: ...to here
leptonica-1.87.0/src/partify.c:181:17: call_function: calling ‘pixLocateStaveSets’ from ‘partifyPixac’
#  259|           /* Find the stave sets at 4x reduction */
#  260|       pix1 = pixMorphSequence(pixs, "r11", 0);
#  261|->     boxa1 = pixConnCompBB(pix1, 8);
#  262|       boxa2 = boxaSelectByArea(boxa1, 15000, L_SELECT_IF_GT, NULL);
#  263|       boxa3 = boxaSort(boxa2, L_SORT_BY_Y, L_SORT_INCREASING, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1153]
leptonica-1.87.0/src/partify.c:262:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:121:1: enter_function: entry to ‘partifyPixac’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:177:16: branch_false: ...to here
leptonica-1.87.0/src/partify.c:181:17: call_function: calling ‘pixLocateStaveSets’ from ‘partifyPixac’
#  260|       pix1 = pixMorphSequence(pixs, "r11", 0);
#  261|       boxa1 = pixConnCompBB(pix1, 8);
#  262|->     boxa2 = boxaSelectByArea(boxa1, 15000, L_SELECT_IF_GT, NULL);
#  263|       boxa3 = boxaSort(boxa2, L_SORT_BY_Y, L_SORT_INCREASING, NULL);
#  264|       if (pixadb) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1154]
leptonica-1.87.0/src/partify.c:263:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:121:1: enter_function: entry to ‘partifyPixac’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:177:16: branch_false: ...to here
leptonica-1.87.0/src/partify.c:181:17: call_function: calling ‘pixLocateStaveSets’ from ‘partifyPixac’
#  261|       boxa1 = pixConnCompBB(pix1, 8);
#  262|       boxa2 = boxaSelectByArea(boxa1, 15000, L_SELECT_IF_GT, NULL);
#  263|->     boxa3 = boxaSort(boxa2, L_SORT_BY_Y, L_SORT_INCREASING, NULL);
#  264|       if (pixadb) {
#  265|           pix2 = pixConvertTo32(pix1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1155]
leptonica-1.87.0/src/partify.c:265:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:121:1: enter_function: entry to ‘partifyPixac’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:177:16: branch_false: ...to here
leptonica-1.87.0/src/partify.c:181:17: call_function: calling ‘pixLocateStaveSets’ from ‘partifyPixac’
#  263|       boxa3 = boxaSort(boxa2, L_SORT_BY_Y, L_SORT_INCREASING, NULL);
#  264|       if (pixadb) {
#  265|->         pix2 = pixConvertTo32(pix1);
#  266|           pixRenderBoxaArb(pix2, boxa3, 2, 255, 0, 0);
#  267|           pixaAddPix(pixadb, pix2, L_INSERT);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1156]
leptonica-1.87.0/src/partify.c:266:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:121:1: enter_function: entry to ‘partifyPixac’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:177:16: branch_false: ...to here
leptonica-1.87.0/src/partify.c:181:17: call_function: calling ‘pixLocateStaveSets’ from ‘partifyPixac’
#  264|       if (pixadb) {
#  265|           pix2 = pixConvertTo32(pix1);
#  266|->         pixRenderBoxaArb(pix2, boxa3, 2, 255, 0, 0);
#  267|           pixaAddPix(pixadb, pix2, L_INSERT);
#  268|           pixDisplay(pix2, 100 * pageno, 100);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1157]
leptonica-1.87.0/src/partify.c:267:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaca’
leptonica-1.87.0/src/partify.c:121:1: enter_function: entry to ‘partifyPixac’
leptonica-1.87.0/src/partify.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/partify.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:141:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:141:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:145:24: acquire_memory: allocated here
leptonica-1.87.0/src/partify.c:146:17: branch_false: following ‘false’ branch (when ‘nparts <= i’)...
leptonica-1.87.0/src/partify.c:151:11: branch_false: ...to here
leptonica-1.87.0/src/partify.c:152:22: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/partify.c:153:21: branch_true: ...to here
leptonica-1.87.0/src/partify.c:173:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:177:16: branch_false: ...to here
leptonica-1.87.0/src/partify.c:181:17: call_function: calling ‘pixLocateStaveSets’ from ‘partifyPixac’
#  265|           pix2 = pixConvertTo32(pix1);
#  266|           pixRenderBoxaArb(pix2, boxa3, 2, 255, 0, 0);
#  267|->         pixaAddPix(pixadb, pix2, L_INSERT);
#  268|           pixDisplay(pix2, 100 * pageno, 100);
#  269|       }

Error: CPPCHECK_WARNING (CWE-457): [#def1158]
leptonica-1.87.0/src/partify.c:315: warning[uninitvar]: Uninitialized variable: delta
#  313|           boxaAdjustBoxSides(boxa, i + 1, 0, 0, -delta, 0);
#  314|       }
#  315|->     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#  316|       return 0;
#  317|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1159]
leptonica-1.87.0/src/partify.c:315:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘delta’
leptonica-1.87.0/src/partify.c:304:8: branch_false: following ‘false’ branch (when ‘boxa’ is non-NULL)...
leptonica-1.87.0/src/partify.c:306:17: branch_false: ...to here
leptonica-1.87.0/src/partify.c:306:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/partify.c:308:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partify.c:315:5: branch_false: ...to here
leptonica-1.87.0/src/partify.c:315:5: danger: use of uninitialized value ‘delta’ here
#  313|           boxaAdjustBoxSides(boxa, i + 1, 0, 0, -delta, 0);
#  314|       }
#  315|->     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#  316|       return 0;
#  317|   }

Error: COMPILER_WARNING (CWE-457): [#def1160]
leptonica-1.87.0/src/partify.c: scope_hint: In function ‘boxaRemoveVGaps.isra.0’
leptonica-1.87.0/src/partify.c:315:5: warning[-Wmaybe-uninitialized]: ‘delta’ may be used uninitialized
#  315 |     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/partify.c:302:35: note: ‘delta’ was declared here
#  302 | l_int32  nbox, i, y1, h1, y2, h2, delta;
#      |                                   ^~~~~
#  313|           boxaAdjustBoxSides(boxa, i + 1, 0, 0, -delta, 0);
#  314|       }
#  315|->     boxaAdjustBoxSides(boxa, nbox - 1, 0, 0, 0, delta);  /* bot of last */
#  316|       return 0;
#  317|   }

Error: COMPILER_WARNING: [#def1161]
leptonica-1.87.0/src/partition.c: scope_hint: In function ‘boxaGetWhiteblocks’
leptonica-1.87.0/src/partition.c:201:28: warning[-Wunused-but-set-variable=]: variable ‘npush’ set but not used
#  201 | l_int32  i, w, h, n, nsub, npush, npop;
#      |                            ^~~~~
#  199|                      l_int32    maxpops)
#  200|   {
#  201|-> l_int32  i, w, h, n, nsub, npush, npop;
#  202|   BOX     *boxsub;
#  203|   BOXA    *boxa, *boxa4, *boxasub, *boxad;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1162]
leptonica-1.87.0/src/partition.c:231:20: warning[-Wanalyzer-malloc-leak]: leak of ‘partelCreate(box)’
leptonica-1.87.0/src/partition.c:192:1: enter_function: entry to ‘boxaGetWhiteblocks’
leptonica-1.87.0/src/partition.c:207:8: branch_false: following ‘false’ branch (when ‘boxas’ is non-NULL)...
leptonica-1.87.0/src/partition.c:209:9: branch_false: ...to here
leptonica-1.87.0/src/partition.c:209:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partition.c:214:8: branch_false: ...to here
leptonica-1.87.0/src/partition.c:218:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partition.c:230:14: call_function: calling ‘partelCreate’ from ‘boxaGetWhiteblocks’
leptonica-1.87.0/src/partition.c:230:14: return_function: returning to ‘boxaGetWhiteblocks’ from ‘partelCreate’
leptonica-1.87.0/src/partition.c:231:20: throw: if ‘boxaCopy’ throws an exception...
leptonica-1.87.0/src/partition.c:231:20: danger: ‘partelCreate(box)’ leaks here; was allocated at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#  229|       lh = lheapCreate(20, L_SORT_DECREASING);
#  230|       partel = partelCreate(box);
#  231|->     partel->boxa = boxaCopy(boxas, L_CLONE);
#  232|       partelSetSize(partel, sortflag);
#  233|       lheapAdd(lh, partel);

Error: CPPCHECK_WARNING (CWE-476): [#def1163]
leptonica-1.87.0/src/partition.c:319: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: partel
#  317|   
#  318|       partel = (PARTEL *)LEPT_CALLOC(1, sizeof(PARTEL));
#  319|->     partel->box = boxCopy(box);
#  320|       return partel;
#  321|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1164]
leptonica-1.87.0/src/partition.c:319:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘partel’
leptonica-1.87.0/src/partition.c:318:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/partition.c:319:5: danger: ‘partel’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  317|   
#  318|       partel = (PARTEL *)LEPT_CALLOC(1, sizeof(PARTEL));
#  319|->     partel->box = boxCopy(box);
#  320|       return partel;
#  321|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1165]
leptonica-1.87.0/src/partition.c:319:19: warning[-Wanalyzer-malloc-leak]: leak of ‘partel’
leptonica-1.87.0/src/partition.c:318:24: acquire_memory: allocated here
leptonica-1.87.0/src/partition.c:319:19: throw: if ‘boxCopy’ throws an exception...
leptonica-1.87.0/src/partition.c:319:19: danger: ‘partel’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  317|   
#  318|       partel = (PARTEL *)LEPT_CALLOC(1, sizeof(PARTEL));
#  319|->     partel->box = boxCopy(box);
#  320|       return partel;
#  321|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1166]
leptonica-1.87.0/src/partition.c:369:20: warning[-Wanalyzer-malloc-leak]: leak of ‘partelCreate(box)’
leptonica-1.87.0/src/partition.c:192:1: enter_function: entry to ‘boxaGetWhiteblocks’
leptonica-1.87.0/src/partition.c:207:8: branch_false: following ‘false’ branch (when ‘boxas’ is non-NULL)...
leptonica-1.87.0/src/partition.c:209:9: branch_false: ...to here
leptonica-1.87.0/src/partition.c:209:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partition.c:214:8: branch_false: ...to here
leptonica-1.87.0/src/partition.c:218:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/partition.c:230:14: call_function: calling ‘partelCreate’ from ‘boxaGetWhiteblocks’
leptonica-1.87.0/src/partition.c:230:14: return_function: returning to ‘boxaGetWhiteblocks’ from ‘partelCreate’
leptonica-1.87.0/src/partition.c:232:5: call_function: calling ‘partelSetSize’ from ‘boxaGetWhiteblocks’
#  367|           return ERROR_INT("partel not defined", __func__, 1);
#  368|   
#  369|->     boxGetGeometry(partel->box, NULL, NULL, &w, &h);
#  370|       if (sortflag == L_SORT_BY_WIDTH)
#  371|           partel->size = (l_float32)w;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1167]
leptonica-1.87.0/src/pdfio2.c:855:20: warning[-Wanalyzer-malloc-leak]: leak of ‘datacomp’
leptonica-1.87.0/src/pdfio2.c:747:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:750:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:756:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:45: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:785:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:788:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:793:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:797:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:797:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:807:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:807:32: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: following ‘false’ branch (when ‘datacomp’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:823:18: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:825:22: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:829:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:839:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:839:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:845:13: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:845:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:847:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:855:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:855:20: throw: if ‘pixcmapCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:855:20: danger: ‘datacomp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16)
#  853|                   return NULL;
#  854|               }
#  855|->             cmap = pixcmapCreate(bps);
#  856|               for (j = i; j < i + n; j += 3) {
#  857|                   pixcmapAddColor(cmap, pngcomp[j], pngcomp[j + 1],

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1168]
leptonica-1.87.0/src/pdfio2.c:857:17: warning[-Wanalyzer-malloc-leak]: leak of ‘datacomp’
leptonica-1.87.0/src/pdfio2.c:747:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:750:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:756:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:45: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:785:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:788:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:793:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:797:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:797:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:807:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:807:32: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: following ‘false’ branch (when ‘datacomp’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:823:18: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:825:22: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:829:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:839:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:839:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:845:13: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:845:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:847:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:855:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:856:25: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:858:41: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:857:17: throw: if ‘pixcmapAddColor’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:857:17: danger: ‘datacomp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/16)
#  855|               cmap = pixcmapCreate(bps);
#  856|               for (j = i; j < i + n; j += 3) {
#  857|->                 pixcmapAddColor(cmap, pngcomp[j], pngcomp[j + 1],
#  858|                                   pngcomp[j + 2]);
#  859|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1169]
leptonica-1.87.0/src/pdfio2.c:874:9: warning[-Wanalyzer-malloc-leak]: leak of ‘datacomp’
leptonica-1.87.0/src/pdfio2.c:747:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:750:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:756:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:45: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:785:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:788:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:793:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:797:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:797:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:807:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:807:32: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: following ‘false’ branch (when ‘datacomp’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:823:18: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:825:22: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:829:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:839:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:839:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:845:13: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:845:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:847:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:855:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:856:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:861:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:823:18: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:825:22: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:829:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:839:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:865:8: branch_false: following ‘false’ branch (when ‘nbytescomp != 0’)...
leptonica-1.87.0/src/pdfio2.c:872:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:873:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:874:9: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:874:9: throw: if ‘pixcmapSerializeToMemory’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:874:9: danger: ‘datacomp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/16)
#  872|       ncolors = 0;
#  873|       if (cmap) {
#  874|->         pixcmapSerializeToMemory(cmap, 3, &ncolors, &cmapdata);
#  875|           pixcmapDestroy(&cmap);
#  876|           if (!cmapdata) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1170]
leptonica-1.87.0/src/pdfio2.c:875:9: warning[-Wanalyzer-malloc-leak]: leak of ‘datacomp’
leptonica-1.87.0/src/pdfio2.c:747:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:750:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:756:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:45: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:785:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:788:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:793:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:797:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:797:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:807:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:807:32: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: following ‘false’ branch (when ‘datacomp’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:823:18: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:825:22: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:829:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:839:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:839:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:845:13: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:845:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:847:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:855:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:856:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:861:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:823:18: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:825:22: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:829:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:839:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:865:8: branch_false: following ‘false’ branch (when ‘nbytescomp != 0’)...
leptonica-1.87.0/src/pdfio2.c:872:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:873:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:874:9: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:875:9: throw: if ‘pixcmapDestroy’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:875:9: danger: ‘datacomp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/16)
#  873|       if (cmap) {
#  874|           pixcmapSerializeToMemory(cmap, 3, &ncolors, &cmapdata);
#  875|->         pixcmapDestroy(&cmap);
#  876|           if (!cmapdata) {
#  877|               LEPT_FREE(datacomp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1171]
leptonica-1.87.0/src/pdfio2.c:881:23: warning[-Wanalyzer-malloc-leak]: leak of ‘datacomp’
leptonica-1.87.0/src/pdfio2.c:747:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:750:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:756:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:45: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:785:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:788:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:793:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:797:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:797:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:807:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:807:32: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: following ‘false’ branch (when ‘datacomp’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:823:18: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:825:22: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:829:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:839:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:839:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:845:13: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:845:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:847:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:855:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:856:25: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:861:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:823:18: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:825:22: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:829:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:839:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:865:8: branch_false: following ‘false’ branch (when ‘nbytescomp != 0’)...
leptonica-1.87.0/src/pdfio2.c:872:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:873:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:874:9: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:876:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:881:23: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:881:23: throw: if ‘pixcmapConvertToHex’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:881:23: danger: ‘datacomp’ leaks here; was allocated at [(17)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/16)
#  879|                                               __func__, NULL);
#  880|           }
#  881|->         cmapdatahex = pixcmapConvertToHex(cmapdata, ncolors);
#  882|           LEPT_FREE(cmapdata);
#  883|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1172]
leptonica-1.87.0/src/pdfio2.c:893: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  891|            * whose type can be inferred from the byte itself.  */
#  892|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
#  893|->     cid->datacomp = datacomp;
#  894|       cid->type = L_FLATE_ENCODE;
#  895|       cid->cmapdatahex = cmapdatahex;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1173]
leptonica-1.87.0/src/pdfio2.c:893:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.87.0/src/pdfio2.c:747:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:750:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:756:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:768:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:769:45: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:769:31: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:785:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:788:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:793:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:797:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:797:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:807:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: following ‘false’ branch (when ‘datacomp’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:807:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:823:18: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:825:22: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:829:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:839:32: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:839:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:840:43: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:823:18: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:863:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:865:8: branch_false: following ‘false’ branch (when ‘nbytescomp != 0’)...
leptonica-1.87.0/src/pdfio2.c:872:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:873:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:892:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:892:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:893:5: danger: ‘cid’ could be NULL: unchecked value from [(31)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/30)
#  891|            * whose type can be inferred from the byte itself.  */
#  892|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
#  893|->     cid->datacomp = datacomp;
#  894|       cid->type = L_FLATE_ENCODE;
#  895|       cid->cmapdatahex = cmapdatahex;

Error: CPPCHECK_WARNING (CWE-476): [#def1174]
leptonica-1.87.0/src/pdfio2.c:894: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  892|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
#  893|       cid->datacomp = datacomp;
#  894|->     cid->type = L_FLATE_ENCODE;
#  895|       cid->cmapdatahex = cmapdatahex;
#  896|       cid->nbytescomp = nbytescomp;

Error: CPPCHECK_WARNING (CWE-476): [#def1175]
leptonica-1.87.0/src/pdfio2.c:895: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  893|       cid->datacomp = datacomp;
#  894|       cid->type = L_FLATE_ENCODE;
#  895|->     cid->cmapdatahex = cmapdatahex;
#  896|       cid->nbytescomp = nbytescomp;
#  897|       cid->ncolors = ncolors;

Error: CPPCHECK_WARNING (CWE-476): [#def1176]
leptonica-1.87.0/src/pdfio2.c:896: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  894|       cid->type = L_FLATE_ENCODE;
#  895|       cid->cmapdatahex = cmapdatahex;
#  896|->     cid->nbytescomp = nbytescomp;
#  897|       cid->ncolors = ncolors;
#  898|       cid->predictor = TRUE;

Error: CPPCHECK_WARNING (CWE-476): [#def1177]
leptonica-1.87.0/src/pdfio2.c:897: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  895|       cid->cmapdatahex = cmapdatahex;
#  896|       cid->nbytescomp = nbytescomp;
#  897|->     cid->ncolors = ncolors;
#  898|       cid->predictor = TRUE;
#  899|       cid->w = w;

Error: CPPCHECK_WARNING (CWE-476): [#def1178]
leptonica-1.87.0/src/pdfio2.c:898: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  896|       cid->nbytescomp = nbytescomp;
#  897|       cid->ncolors = ncolors;
#  898|->     cid->predictor = TRUE;
#  899|       cid->w = w;
#  900|       cid->h = h;

Error: CPPCHECK_WARNING (CWE-476): [#def1179]
leptonica-1.87.0/src/pdfio2.c:899: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  897|       cid->ncolors = ncolors;
#  898|       cid->predictor = TRUE;
#  899|->     cid->w = w;
#  900|       cid->h = h;
#  901|       cid->bps = bps;

Error: CPPCHECK_WARNING (CWE-476): [#def1180]
leptonica-1.87.0/src/pdfio2.c:900: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  898|       cid->predictor = TRUE;
#  899|       cid->w = w;
#  900|->     cid->h = h;
#  901|       cid->bps = bps;
#  902|       cid->spp = spp;

Error: CPPCHECK_WARNING (CWE-476): [#def1181]
leptonica-1.87.0/src/pdfio2.c:901: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  899|       cid->w = w;
#  900|       cid->h = h;
#  901|->     cid->bps = bps;
#  902|       cid->spp = spp;
#  903|       cid->res = xres;

Error: CPPCHECK_WARNING (CWE-476): [#def1182]
leptonica-1.87.0/src/pdfio2.c:902: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  900|       cid->h = h;
#  901|       cid->bps = bps;
#  902|->     cid->spp = spp;
#  903|       cid->res = xres;
#  904|       return cid;

Error: CPPCHECK_WARNING (CWE-476): [#def1183]
leptonica-1.87.0/src/pdfio2.c:903: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  901|       cid->bps = bps;
#  902|       cid->spp = spp;
#  903|->     cid->res = xres;
#  904|       return cid;
#  905|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1184]
leptonica-1.87.0/src/pdfio2.c:970: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  968|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
#  969|       if (ascii85flag == 0) {
#  970|->         cid->datacomp = data;
#  971|       } else {  /* ascii85 */
#  972|           cid->data85 = data85;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1185]
leptonica-1.87.0/src/pdfio2.c:970:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.87.0/src/pdfio2.c:935:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:938:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:938:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:942:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:945:15: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:945:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:948:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:953:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:958:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:958:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:968:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:968:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:969:8: branch_true: following ‘true’ branch (when ‘ascii85flag == 0’)...
leptonica-1.87.0/src/pdfio2.c:970:9: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:970:9: danger: ‘cid’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
#  968|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
#  969|       if (ascii85flag == 0) {
#  970|->         cid->datacomp = data;
#  971|       } else {  /* ascii85 */
#  972|           cid->data85 = data85;

Error: CPPCHECK_WARNING (CWE-476): [#def1186]
leptonica-1.87.0/src/pdfio2.c:972: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  970|           cid->datacomp = data;
#  971|       } else {  /* ascii85 */
#  972|->         cid->data85 = data85;
#  973|           cid->nbytes85 = nbytes85;
#  974|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1187]
leptonica-1.87.0/src/pdfio2.c:972:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.87.0/src/pdfio2.c:935:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:938:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:938:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:942:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:945:15: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:945:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:948:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:953:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:958:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:958:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:968:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:968:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:969:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 0’)...
leptonica-1.87.0/src/pdfio2.c:972:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:972:9: danger: ‘cid’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
#  970|           cid->datacomp = data;
#  971|       } else {  /* ascii85 */
#  972|->         cid->data85 = data85;
#  973|           cid->nbytes85 = nbytes85;
#  974|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1188]
leptonica-1.87.0/src/pdfio2.c:973: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  971|       } else {  /* ascii85 */
#  972|           cid->data85 = data85;
#  973|->         cid->nbytes85 = nbytes85;
#  974|       }
#  975|       cid->type = L_JPEG_ENCODE;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1189]
leptonica-1.87.0/src/pdfio2.c:973:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nbytes85’
leptonica-1.87.0/src/pdfio2.c:935:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:938:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:938:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:942:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:945:15: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:945:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:948:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:953:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:958:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:958:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:968:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:969:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 0’)...
leptonica-1.87.0/src/pdfio2.c:972:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:973:9: danger: use of uninitialized value ‘nbytes85’ here
#  971|       } else {  /* ascii85 */
#  972|           cid->data85 = data85;
#  973|->         cid->nbytes85 = nbytes85;
#  974|       }
#  975|       cid->type = L_JPEG_ENCODE;

Error: CPPCHECK_WARNING (CWE-476): [#def1190]
leptonica-1.87.0/src/pdfio2.c:975: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  973|           cid->nbytes85 = nbytes85;
#  974|       }
#  975|->     cid->type = L_JPEG_ENCODE;
#  976|       cid->nbytescomp = nbytes;
#  977|       cid->w = w;

Error: CPPCHECK_WARNING (CWE-476): [#def1191]
leptonica-1.87.0/src/pdfio2.c:976: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  974|       }
#  975|       cid->type = L_JPEG_ENCODE;
#  976|->     cid->nbytescomp = nbytes;
#  977|       cid->w = w;
#  978|       cid->h = h;

Error: CPPCHECK_WARNING (CWE-476): [#def1192]
leptonica-1.87.0/src/pdfio2.c:977: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  975|       cid->type = L_JPEG_ENCODE;
#  976|       cid->nbytescomp = nbytes;
#  977|->     cid->w = w;
#  978|       cid->h = h;
#  979|       cid->bps = bps;

Error: CPPCHECK_WARNING (CWE-476): [#def1193]
leptonica-1.87.0/src/pdfio2.c:978: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  976|       cid->nbytescomp = nbytes;
#  977|       cid->w = w;
#  978|->     cid->h = h;
#  979|       cid->bps = bps;
#  980|       cid->spp = spp;

Error: CPPCHECK_WARNING (CWE-476): [#def1194]
leptonica-1.87.0/src/pdfio2.c:979: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  977|       cid->w = w;
#  978|       cid->h = h;
#  979|->     cid->bps = bps;
#  980|       cid->spp = spp;
#  981|       cid->res = xres;

Error: CPPCHECK_WARNING (CWE-476): [#def1195]
leptonica-1.87.0/src/pdfio2.c:980: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  978|       cid->h = h;
#  979|       cid->bps = bps;
#  980|->     cid->spp = spp;
#  981|       cid->res = xres;
#  982|       return cid;

Error: CPPCHECK_WARNING (CWE-476): [#def1196]
leptonica-1.87.0/src/pdfio2.c:981: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
#  979|       cid->bps = bps;
#  980|       cid->spp = spp;
#  981|->     cid->res = xres;
#  982|       return cid;
#  983|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1197]
leptonica-1.87.0/src/pdfio2.c:1034: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1032|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1033|       if (ascii85flag == 0) {
# 1034|->         cid->datacomp = data;
# 1035|       } else {  /* ascii85 */
# 1036|           cid->data85 = data85;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1198]
leptonica-1.87.0/src/pdfio2.c:1034:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.87.0/src/pdfio2.c:1011:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1015:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1015:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1023:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:1032:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1032:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:1033:8: branch_true: following ‘true’ branch (when ‘ascii85flag == 0’)...
leptonica-1.87.0/src/pdfio2.c:1034:9: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:1034:9: danger: ‘cid’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/6)
# 1032|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1033|       if (ascii85flag == 0) {
# 1034|->         cid->datacomp = data;
# 1035|       } else {  /* ascii85 */
# 1036|           cid->data85 = data85;

Error: CPPCHECK_WARNING (CWE-476): [#def1199]
leptonica-1.87.0/src/pdfio2.c:1036: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1034|           cid->datacomp = data;
# 1035|       } else {  /* ascii85 */
# 1036|->         cid->data85 = data85;
# 1037|           cid->nbytes85 = nbytes85;
# 1038|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1200]
leptonica-1.87.0/src/pdfio2.c:1036:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.87.0/src/pdfio2.c:1011:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1015:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1015:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1023:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:1032:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1032:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:1033:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 0’)...
leptonica-1.87.0/src/pdfio2.c:1036:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1036:9: danger: ‘cid’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/6)
# 1034|           cid->datacomp = data;
# 1035|       } else {  /* ascii85 */
# 1036|->         cid->data85 = data85;
# 1037|           cid->nbytes85 = nbytes85;
# 1038|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1201]
leptonica-1.87.0/src/pdfio2.c:1037: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1035|       } else {  /* ascii85 */
# 1036|           cid->data85 = data85;
# 1037|->         cid->nbytes85 = nbytes85;
# 1038|       }
# 1039|       cid->type = L_JPEG_ENCODE;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1202]
leptonica-1.87.0/src/pdfio2.c:1037:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nbytes85’
leptonica-1.87.0/src/pdfio2.c:1011:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1015:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1015:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1020:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1023:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:1032:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1033:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 0’)...
leptonica-1.87.0/src/pdfio2.c:1036:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1037:9: danger: use of uninitialized value ‘nbytes85’ here
# 1035|       } else {  /* ascii85 */
# 1036|           cid->data85 = data85;
# 1037|->         cid->nbytes85 = nbytes85;
# 1038|       }
# 1039|       cid->type = L_JPEG_ENCODE;

Error: CPPCHECK_WARNING (CWE-476): [#def1203]
leptonica-1.87.0/src/pdfio2.c:1039: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1037|           cid->nbytes85 = nbytes85;
# 1038|       }
# 1039|->     cid->type = L_JPEG_ENCODE;
# 1040|       cid->nbytescomp = nbytes;
# 1041|       cid->w = w;

Error: CPPCHECK_WARNING (CWE-476): [#def1204]
leptonica-1.87.0/src/pdfio2.c:1040: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1038|       }
# 1039|       cid->type = L_JPEG_ENCODE;
# 1040|->     cid->nbytescomp = nbytes;
# 1041|       cid->w = w;
# 1042|       cid->h = h;

Error: CPPCHECK_WARNING (CWE-476): [#def1205]
leptonica-1.87.0/src/pdfio2.c:1041: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1039|       cid->type = L_JPEG_ENCODE;
# 1040|       cid->nbytescomp = nbytes;
# 1041|->     cid->w = w;
# 1042|       cid->h = h;
# 1043|       cid->bps = bps;

Error: CPPCHECK_WARNING (CWE-476): [#def1206]
leptonica-1.87.0/src/pdfio2.c:1042: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1040|       cid->nbytescomp = nbytes;
# 1041|       cid->w = w;
# 1042|->     cid->h = h;
# 1043|       cid->bps = bps;
# 1044|       cid->spp = spp;

Error: CPPCHECK_WARNING (CWE-476): [#def1207]
leptonica-1.87.0/src/pdfio2.c:1043: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1041|       cid->w = w;
# 1042|       cid->h = h;
# 1043|->     cid->bps = bps;
# 1044|       cid->spp = spp;
# 1045|       cid->res = xres;

Error: CPPCHECK_WARNING (CWE-476): [#def1208]
leptonica-1.87.0/src/pdfio2.c:1044: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1042|       cid->h = h;
# 1043|       cid->bps = bps;
# 1044|->     cid->spp = spp;
# 1045|       cid->res = xres;
# 1046|       return cid;

Error: CPPCHECK_WARNING (CWE-476): [#def1209]
leptonica-1.87.0/src/pdfio2.c:1045: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1043|       cid->bps = bps;
# 1044|       cid->spp = spp;
# 1045|->     cid->res = xres;
# 1046|       return cid;
# 1047|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1210]
leptonica-1.87.0/src/pdfio2.c:1077: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1075|           /* The returned jp2k data in memory is the entire jp2k file */
# 1076|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1077|->     if ((cid->datacomp = l_binaryRead(fname, &nbytes)) == NULL) {
# 1078|           l_CIDataDestroy(&cid);
# 1079|           return (L_COMP_DATA *)ERROR_PTR("data not extracted", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1211]
leptonica-1.87.0/src/pdfio2.c:1077:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.87.0/src/pdfio2.c:1072:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1076:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1076:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:1077:9: danger: ‘calloc(1, 104)’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 1075|           /* The returned jp2k data in memory is the entire jp2k file */
# 1076|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1077|->     if ((cid->datacomp = l_binaryRead(fname, &nbytes)) == NULL) {
# 1078|           l_CIDataDestroy(&cid);
# 1079|           return (L_COMP_DATA *)ERROR_PTR("data not extracted", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1212]
leptonica-1.87.0/src/pdfio2.c:1077:26: warning[-Wanalyzer-malloc-leak]: leak of ‘cid’
leptonica-1.87.0/src/pdfio2.c:1072:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1076:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1076:26: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1077:26: throw: if ‘l_binaryRead’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1077:26: danger: ‘cid’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 1075|           /* The returned jp2k data in memory is the entire jp2k file */
# 1076|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1077|->     if ((cid->datacomp = l_binaryRead(fname, &nbytes)) == NULL) {
# 1078|           l_CIDataDestroy(&cid);
# 1079|           return (L_COMP_DATA *)ERROR_PTR("data not extracted", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1213]
leptonica-1.87.0/src/pdfio2.c:1083:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cid’
leptonica-1.87.0/src/pdfio2.c:1072:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1076:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1076:26: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1077:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1082:12: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1083:15: throw: if ‘fopenReadStream’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1083:15: danger: ‘cid’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
# 1081|   
# 1082|       xres = yres = 0;
# 1083|->     if ((fp = fopenReadStream(fname)) != NULL) {
# 1084|           fgetJp2kResolution(fp, &xres, &yres);
# 1085|           fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1214]
leptonica-1.87.0/src/pdfio2.c:1084:9: warning[-Wanalyzer-malloc-leak]: leak of ‘cid’
leptonica-1.87.0/src/pdfio2.c:1072:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1076:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1076:26: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1077:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1082:12: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1083:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:1084:9: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:1084:9: throw: if ‘fgetJp2kResolution’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1084:9: danger: ‘cid’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 1082|       xres = yres = 0;
# 1083|       if ((fp = fopenReadStream(fname)) != NULL) {
# 1084|->         fgetJp2kResolution(fp, &xres, &yres);
# 1085|           fclose(fp);
# 1086|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1215]
leptonica-1.87.0/src/pdfio2.c:1168: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1166|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1167|       if (ascii85flag == 0) {
# 1168|->         cid->datacomp = datacomp;
# 1169|       } else {  /* ascii85 */
# 1170|           cid->data85 = data85;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1216]
leptonica-1.87.0/src/pdfio2.c:1168:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.87.0/src/pdfio2.c:1125:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1129:15: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1129:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1132:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1134:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1140:15: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1143:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1149:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1156:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1156:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:1166:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1166:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:1167:8: branch_true: following ‘true’ branch (when ‘ascii85flag == 0’)...
leptonica-1.87.0/src/pdfio2.c:1168:9: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:1168:9: danger: ‘cid’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/12)
# 1166|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1167|       if (ascii85flag == 0) {
# 1168|->         cid->datacomp = datacomp;
# 1169|       } else {  /* ascii85 */
# 1170|           cid->data85 = data85;

Error: CPPCHECK_WARNING (CWE-476): [#def1217]
leptonica-1.87.0/src/pdfio2.c:1170: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1168|           cid->datacomp = datacomp;
# 1169|       } else {  /* ascii85 */
# 1170|->         cid->data85 = data85;
# 1171|           cid->nbytes85 = nbytes85;
# 1172|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1218]
leptonica-1.87.0/src/pdfio2.c:1170:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.87.0/src/pdfio2.c:1125:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1129:15: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1129:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1132:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1134:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1140:15: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1143:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1149:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1156:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1156:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:1166:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1166:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:1167:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 0’)...
leptonica-1.87.0/src/pdfio2.c:1170:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1170:9: danger: ‘cid’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/12)
# 1168|           cid->datacomp = datacomp;
# 1169|       } else {  /* ascii85 */
# 1170|->         cid->data85 = data85;
# 1171|           cid->nbytes85 = nbytes85;
# 1172|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1219]
leptonica-1.87.0/src/pdfio2.c:1171: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1169|       } else {  /* ascii85 */
# 1170|           cid->data85 = data85;
# 1171|->         cid->nbytes85 = nbytes85;
# 1172|       }
# 1173|       cid->type = L_G4_ENCODE;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1220]
leptonica-1.87.0/src/pdfio2.c:1171:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nbytes85’
leptonica-1.87.0/src/pdfio2.c:1125:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1129:15: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1129:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1132:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1134:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1140:15: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1143:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1149:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1156:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1156:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:1166:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1167:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 0’)...
leptonica-1.87.0/src/pdfio2.c:1170:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1171:9: danger: use of uninitialized value ‘nbytes85’ here
# 1169|       } else {  /* ascii85 */
# 1170|           cid->data85 = data85;
# 1171|->         cid->nbytes85 = nbytes85;
# 1172|       }
# 1173|       cid->type = L_G4_ENCODE;

Error: CPPCHECK_WARNING (CWE-476): [#def1221]
leptonica-1.87.0/src/pdfio2.c:1173: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1171|           cid->nbytes85 = nbytes85;
# 1172|       }
# 1173|->     cid->type = L_G4_ENCODE;
# 1174|       cid->nbytescomp = nbytescomp;
# 1175|       cid->w = w;

Error: CPPCHECK_WARNING (CWE-476): [#def1222]
leptonica-1.87.0/src/pdfio2.c:1174: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1172|       }
# 1173|       cid->type = L_G4_ENCODE;
# 1174|->     cid->nbytescomp = nbytescomp;
# 1175|       cid->w = w;
# 1176|       cid->h = h;

Error: CPPCHECK_WARNING (CWE-476): [#def1223]
leptonica-1.87.0/src/pdfio2.c:1175: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1173|       cid->type = L_G4_ENCODE;
# 1174|       cid->nbytescomp = nbytescomp;
# 1175|->     cid->w = w;
# 1176|       cid->h = h;
# 1177|       cid->bps = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def1224]
leptonica-1.87.0/src/pdfio2.c:1176: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1174|       cid->nbytescomp = nbytescomp;
# 1175|       cid->w = w;
# 1176|->     cid->h = h;
# 1177|       cid->bps = 1;
# 1178|       cid->spp = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def1225]
leptonica-1.87.0/src/pdfio2.c:1177: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1175|       cid->w = w;
# 1176|       cid->h = h;
# 1177|->     cid->bps = 1;
# 1178|       cid->spp = 1;
# 1179|       cid->minisblack = minisblack;

Error: CPPCHECK_WARNING (CWE-476): [#def1226]
leptonica-1.87.0/src/pdfio2.c:1178: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1176|       cid->h = h;
# 1177|       cid->bps = 1;
# 1178|->     cid->spp = 1;
# 1179|       cid->minisblack = minisblack;
# 1180|       cid->res = xres;

Error: CPPCHECK_WARNING (CWE-476): [#def1227]
leptonica-1.87.0/src/pdfio2.c:1179: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1177|       cid->bps = 1;
# 1178|       cid->spp = 1;
# 1179|->     cid->minisblack = minisblack;
# 1180|       cid->res = xres;
# 1181|       return cid;

Error: CPPCHECK_WARNING (CWE-476): [#def1228]
leptonica-1.87.0/src/pdfio2.c:1180: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1178|       cid->spp = 1;
# 1179|       cid->minisblack = minisblack;
# 1180|->     cid->res = xres;
# 1181|       return cid;
# 1182|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1229]
leptonica-1.87.0/src/pdfio2.c:1434: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1432|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1433|       if (ascii85flag == 0) {
# 1434|->         cid->datacomp = datacomp;
# 1435|       } else {  /* ascii85 */
# 1436|           cid->data85 = data85;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1230]
leptonica-1.87.0/src/pdfio2.c:1434:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.87.0/src/pdfio2.c:1363:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1371:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1383:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1385:11: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1390:8: branch_false: following ‘false’ branch (when ‘cmap’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:1404:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1406:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1411:16: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1413:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1420:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1420:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:1432:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1432:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:1433:8: branch_true: following ‘true’ branch (when ‘ascii85flag == 0’)...
leptonica-1.87.0/src/pdfio2.c:1434:9: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:1434:9: danger: ‘cid’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/12)
# 1432|       cid = (L_COMP_DATA *)LEPT_CALLOC(1, sizeof(L_COMP_DATA));
# 1433|       if (ascii85flag == 0) {
# 1434|->         cid->datacomp = datacomp;
# 1435|       } else {  /* ascii85 */
# 1436|           cid->data85 = data85;

Error: CPPCHECK_WARNING (CWE-476): [#def1231]
leptonica-1.87.0/src/pdfio2.c:1436: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1434|           cid->datacomp = datacomp;
# 1435|       } else {  /* ascii85 */
# 1436|->         cid->data85 = data85;
# 1437|           cid->nbytes85 = nbytes85;
# 1438|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1232]
leptonica-1.87.0/src/pdfio2.c:1436:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cid’
leptonica-1.87.0/src/pdfio2.c:1363:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1371:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1383:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1385:11: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1390:8: branch_false: following ‘false’ branch (when ‘cmap’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:1404:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1406:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1411:16: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1413:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1420:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1420:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:1432:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1432:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:1433:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 0’)...
leptonica-1.87.0/src/pdfio2.c:1436:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1436:9: danger: ‘cid’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/12)
# 1434|           cid->datacomp = datacomp;
# 1435|       } else {  /* ascii85 */
# 1436|->         cid->data85 = data85;
# 1437|           cid->nbytes85 = nbytes85;
# 1438|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1233]
leptonica-1.87.0/src/pdfio2.c:1437: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1435|       } else {  /* ascii85 */
# 1436|           cid->data85 = data85;
# 1437|->         cid->nbytes85 = nbytes85;
# 1438|       }
# 1439|       cid->type = L_FLATE_ENCODE;

Error: CPPCHECK_WARNING (CWE-476): [#def1234]
leptonica-1.87.0/src/pdfio2.c:1439: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1437|           cid->nbytes85 = nbytes85;
# 1438|       }
# 1439|->     cid->type = L_FLATE_ENCODE;
# 1440|       cid->cmapdatahex = cmapdatahex;
# 1441|       cid->cmapdata85 = cmapdata85;

Error: CPPCHECK_WARNING (CWE-476): [#def1235]
leptonica-1.87.0/src/pdfio2.c:1440: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1438|       }
# 1439|       cid->type = L_FLATE_ENCODE;
# 1440|->     cid->cmapdatahex = cmapdatahex;
# 1441|       cid->cmapdata85 = cmapdata85;
# 1442|       cid->nbytescomp = nbytescomp;

Error: CPPCHECK_WARNING (CWE-476): [#def1236]
leptonica-1.87.0/src/pdfio2.c:1441: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1439|       cid->type = L_FLATE_ENCODE;
# 1440|       cid->cmapdatahex = cmapdatahex;
# 1441|->     cid->cmapdata85 = cmapdata85;
# 1442|       cid->nbytescomp = nbytescomp;
# 1443|       cid->ncolors = ncolors;

Error: CPPCHECK_WARNING (CWE-476): [#def1237]
leptonica-1.87.0/src/pdfio2.c:1442: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1440|       cid->cmapdatahex = cmapdatahex;
# 1441|       cid->cmapdata85 = cmapdata85;
# 1442|->     cid->nbytescomp = nbytescomp;
# 1443|       cid->ncolors = ncolors;
# 1444|       cid->w = w;

Error: CPPCHECK_WARNING (CWE-476): [#def1238]
leptonica-1.87.0/src/pdfio2.c:1443: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1441|       cid->cmapdata85 = cmapdata85;
# 1442|       cid->nbytescomp = nbytescomp;
# 1443|->     cid->ncolors = ncolors;
# 1444|       cid->w = w;
# 1445|       cid->h = h;

Error: CPPCHECK_WARNING (CWE-476): [#def1239]
leptonica-1.87.0/src/pdfio2.c:1444: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1442|       cid->nbytescomp = nbytescomp;
# 1443|       cid->ncolors = ncolors;
# 1444|->     cid->w = w;
# 1445|       cid->h = h;
# 1446|       cid->bps = bps;

Error: CPPCHECK_WARNING (CWE-476): [#def1240]
leptonica-1.87.0/src/pdfio2.c:1445: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1443|       cid->ncolors = ncolors;
# 1444|       cid->w = w;
# 1445|->     cid->h = h;
# 1446|       cid->bps = bps;
# 1447|       cid->spp = spp;

Error: CPPCHECK_WARNING (CWE-476): [#def1241]
leptonica-1.87.0/src/pdfio2.c:1446: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1444|       cid->w = w;
# 1445|       cid->h = h;
# 1446|->     cid->bps = bps;
# 1447|       cid->spp = spp;
# 1448|       cid->res = pixGetXRes(pixs);

Error: CPPCHECK_WARNING (CWE-476): [#def1242]
leptonica-1.87.0/src/pdfio2.c:1447: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1445|       cid->h = h;
# 1446|       cid->bps = bps;
# 1447|->     cid->spp = spp;
# 1448|       cid->res = pixGetXRes(pixs);
# 1449|       cid->nbytes = nbytes;  /* only for debugging */

Error: CPPCHECK_WARNING (CWE-476): [#def1243]
leptonica-1.87.0/src/pdfio2.c:1448: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1446|       cid->bps = bps;
# 1447|       cid->spp = spp;
# 1448|->     cid->res = pixGetXRes(pixs);
# 1449|       cid->nbytes = nbytes;  /* only for debugging */
# 1450|       return cid;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1244]
leptonica-1.87.0/src/pdfio2.c:1448:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cid’
leptonica-1.87.0/src/pdfio2.c:1363:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1371:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1383:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1385:11: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1390:8: branch_false: following ‘false’ branch (when ‘cmap’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:1404:5: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1406:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1411:16: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1413:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1420:8: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1420:8: branch_false: following ‘false’ branch (when ‘ascii85flag != 1’)...
leptonica-1.87.0/src/pdfio2.c:1432:26: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1432:26: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1433:8: branch_true: following ‘true’ branch (when ‘ascii85flag == 0’)...
leptonica-1.87.0/src/pdfio2.c:1434:9: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:1448:16: throw: if ‘pixGetXRes’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1448:16: danger: ‘cid’ leaks here; was allocated at [(13)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/12)
# 1446|       cid->bps = bps;
# 1447|       cid->spp = spp;
# 1448|->     cid->res = pixGetXRes(pixs);
# 1449|       cid->nbytes = nbytes;  /* only for debugging */
# 1450|       return cid;

Error: CPPCHECK_WARNING (CWE-476): [#def1245]
leptonica-1.87.0/src/pdfio2.c:1449: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cid
# 1447|       cid->spp = spp;
# 1448|       cid->res = pixGetXRes(pixs);
# 1449|->     cid->nbytes = nbytes;  /* only for debugging */
# 1450|       return cid;
# 1451|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1246]
leptonica-1.87.0/src/pdfio2.c:1825:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/pdfio2.c:1815:8: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1817:13: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1824:22: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1825:5: throw: if ‘stringCat’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1825:5: danger: ‘buffer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/2)
# 1823|       buflen = 4 * nchar + 10;
# 1824|       buffer = (char *)LEPT_CALLOC(buflen, sizeof(char));
# 1825|->     stringCat(buffer, buflen, "<feff");
# 1826|       for (i = 0; i < nchar; i++) {
# 1827|           snprintf(smallbuf, sizeof(smallbuf), "%04x", str[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1247]
leptonica-1.87.0/src/pdfio2.c:1881:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:1878:24: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1878:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1881:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1881:5: throw: if ‘boxGetGeometry’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1881:5: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/0)
# 1879|           return ERROR_INT("calloc fail for buf", __func__, 1);
# 1880|   
# 1881|->     boxGetGeometry(lpd->mediabox, NULL, NULL, &wpt, &hpt);
# 1882|       sa = sarrayCreate(lpd->n);
# 1883|       for (i = 0; i < lpd->n; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1248]
leptonica-1.87.0/src/pdfio2.c:1882:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:1878:24: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1878:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1881:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1882:10: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1882:10: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/0)
# 1880|   
# 1881|       boxGetGeometry(lpd->mediabox, NULL, NULL, &wpt, &hpt);
# 1882|->     sa = sarrayCreate(lpd->n);
# 1883|       for (i = 0; i < lpd->n; i++) {
# 1884|           snprintf(buf, bufsize, "/Im%d %d 0 R   ", i + 1, 6 + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1249]
leptonica-1.87.0/src/pdfio2.c:1887:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:1878:24: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1878:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1881:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1883:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1887:12: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1887:12: throw: if ‘sarrayToString’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1887:12: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/0)
# 1885|           sarrayAddString(sa, buf, L_COPY);
# 1886|       }
# 1887|->     xstr = sarrayToString(sa, 0);
# 1888|       sarrayDestroy(&sa);
# 1889|       if (!xstr) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1250]
leptonica-1.87.0/src/pdfio2.c:1888:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:1878:24: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1878:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1881:20: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1883:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1887:12: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1888:5: throw: if ‘sarrayDestroy’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1888:5: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/0)
# 1886|       }
# 1887|       xstr = sarrayToString(sa, 0);
# 1888|->     sarrayDestroy(&sa);
# 1889|       if (!xstr) {
# 1890|           LEPT_FREE(buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1251]
leptonica-1.87.0/src/pdfio2.c:1931:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:1928:24: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1928:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1931:10: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1931:10: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1931:10: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/0)
# 1929|           return ERROR_INT("calloc fail for buf", __func__, 1);
# 1930|   
# 1931|->     sa = sarrayCreate(lpd->n);
# 1932|       for (i = 0; i < lpd->n; i++) {
# 1933|           ptaGetPt(lpd->xy, i, &xpt, &ypt);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1252]
leptonica-1.87.0/src/pdfio2.c:1933:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:1928:24: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1928:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1931:10: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1932:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:1933:18: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:1933:9: throw: if ‘ptaGetPt’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1933:9: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/0)
# 1931|       sa = sarrayCreate(lpd->n);
# 1932|       for (i = 0; i < lpd->n; i++) {
# 1933|->         ptaGetPt(lpd->xy, i, &xpt, &ypt);
# 1934|           ptaGetPt(lpd->wh, i, &wpt, &hpt);
# 1935|           snprintf(buf, bufsize,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1253]
leptonica-1.87.0/src/pdfio2.c:1934:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:1928:24: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1928:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1931:10: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1932:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:1933:18: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:1934:9: throw: if ‘ptaGetPt’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1934:9: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/0)
# 1932|       for (i = 0; i < lpd->n; i++) {
# 1933|           ptaGetPt(lpd->xy, i, &xpt, &ypt);
# 1934|->         ptaGetPt(lpd->wh, i, &wpt, &hpt);
# 1935|           snprintf(buf, bufsize,
# 1936|                    "q %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d Do Q\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1254]
leptonica-1.87.0/src/pdfio2.c:1940:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:1928:24: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1928:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1931:10: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1932:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1940:12: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1940:12: throw: if ‘sarrayToString’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1940:12: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/0)
# 1938|           sarrayAddString(sa, buf, L_COPY);
# 1939|       }
# 1940|->     cstr = sarrayToString(sa, 0);
# 1941|       sarrayDestroy(&sa);
# 1942|       if (!cstr) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1255]
leptonica-1.87.0/src/pdfio2.c:1941:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:1928:24: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:1928:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:1931:10: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1932:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:1940:12: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:1941:5: throw: if ‘sarrayDestroy’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:1941:5: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/0)
# 1939|       }
# 1940|       cstr = sarrayToString(sa, 0);
# 1941|->     sarrayDestroy(&sa);
# 1942|       if (!cstr) {
# 1943|           LEPT_FREE(buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1256]
leptonica-1.87.0/src/pdfio2.c:2410:10: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:2404:8: branch_false: following ‘false’ branch (when ‘napage’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:2407:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2409:19: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2410:10: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2410:10: danger: ‘buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/2)
# 2408|       bufsize = 100 + 16 * n;  /* large enough to hold the output string */
# 2409|       buf = (char *)LEPT_CALLOC(bufsize, sizeof(char));
# 2410|->     sa = sarrayCreate(n);
# 2411|       for (i = 0; i < n; i++) {
# 2412|           numaGetIValue(napage, i, &index);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1257]
leptonica-1.87.0/src/pdfio2.c:2412:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:2404:8: branch_false: following ‘false’ branch (when ‘napage’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:2407:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2409:19: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2411:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pdfio2.c:2412:9: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:2412:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2412:9: danger: ‘buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/2)
# 2410|       sa = sarrayCreate(n);
# 2411|       for (i = 0; i < n; i++) {
# 2412|->         numaGetIValue(napage, i, &index);
# 2413|           snprintf(buf, bufsize, " %d 0 R ", index);
# 2414|           sarrayAddString(sa, buf, L_COPY);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1258]
leptonica-1.87.0/src/pdfio2.c:2417:11: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
leptonica-1.87.0/src/pdfio2.c:2404:8: branch_false: following ‘false’ branch (when ‘napage’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:2407:9: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2409:19: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2411:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pdfio2.c:2417:11: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2417:11: throw: if ‘sarrayToString’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2417:11: danger: ‘buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/2)
# 2415|       }
# 2416|   
# 2417|->     str = sarrayToString(sa, 0);
# 2418|       snprintf(buf, bufsize - 1, "3 0 obj\n"
# 2419|                                  "<<\n"

Error: CPPCHECK_WARNING (CWE-476): [#def1259]
leptonica-1.87.0/src/pdfio2.c:2534: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lpd
# 2532|   
# 2533|       lpd = (L_PDF_DATA *)LEPT_CALLOC(1, sizeof(L_PDF_DATA));
# 2534|->     if (title) lpd->title = stringNew(title);
# 2535|       lpd->cida = ptraCreate(10);
# 2536|       lpd->xy = ptaCreate(10);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1260]
leptonica-1.87.0/src/pdfio2.c:2534:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lpd’
leptonica-1.87.0/src/pdfio2.c:2533:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:2534:8: branch_true: following ‘true’ branch (when ‘title’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:2534:29: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:2534:16: danger: ‘lpd’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/0)
# 2532|   
# 2533|       lpd = (L_PDF_DATA *)LEPT_CALLOC(1, sizeof(L_PDF_DATA));
# 2534|->     if (title) lpd->title = stringNew(title);
# 2535|       lpd->cida = ptraCreate(10);
# 2536|       lpd->xy = ptaCreate(10);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1261]
leptonica-1.87.0/src/pdfio2.c:2534:29: warning[-Wanalyzer-malloc-leak]: leak of ‘lpd’
leptonica-1.87.0/src/pdfio2.c:2533:25: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2534:8: branch_true: following ‘true’ branch (when ‘title’ is non-NULL)...
leptonica-1.87.0/src/pdfio2.c:2534:29: branch_true: ...to here
leptonica-1.87.0/src/pdfio2.c:2534:29: throw: if ‘stringNew’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2534:29: danger: ‘lpd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/0)
# 2532|   
# 2533|       lpd = (L_PDF_DATA *)LEPT_CALLOC(1, sizeof(L_PDF_DATA));
# 2534|->     if (title) lpd->title = stringNew(title);
# 2535|       lpd->cida = ptraCreate(10);
# 2536|       lpd->xy = ptaCreate(10);

Error: CPPCHECK_WARNING (CWE-476): [#def1262]
leptonica-1.87.0/src/pdfio2.c:2535: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lpd
# 2533|       lpd = (L_PDF_DATA *)LEPT_CALLOC(1, sizeof(L_PDF_DATA));
# 2534|       if (title) lpd->title = stringNew(title);
# 2535|->     lpd->cida = ptraCreate(10);
# 2536|       lpd->xy = ptaCreate(10);
# 2537|       lpd->wh = ptaCreate(10);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1263]
leptonica-1.87.0/src/pdfio2.c:2535:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lpd’
leptonica-1.87.0/src/pdfio2.c:2533:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pdfio2.c:2534:8: branch_false: following ‘false’ branch (when ‘title’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:2535:17: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2535:5: danger: ‘lpd’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/0)
# 2533|       lpd = (L_PDF_DATA *)LEPT_CALLOC(1, sizeof(L_PDF_DATA));
# 2534|       if (title) lpd->title = stringNew(title);
# 2535|->     lpd->cida = ptraCreate(10);
# 2536|       lpd->xy = ptaCreate(10);
# 2537|       lpd->wh = ptaCreate(10);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1264]
leptonica-1.87.0/src/pdfio2.c:2535:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lpd’
leptonica-1.87.0/src/pdfio2.c:2533:25: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2534:8: branch_false: following ‘false’ branch (when ‘title’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:2535:17: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2535:17: throw: if ‘ptraCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2535:17: danger: ‘lpd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/0)
# 2533|       lpd = (L_PDF_DATA *)LEPT_CALLOC(1, sizeof(L_PDF_DATA));
# 2534|       if (title) lpd->title = stringNew(title);
# 2535|->     lpd->cida = ptraCreate(10);
# 2536|       lpd->xy = ptaCreate(10);
# 2537|       lpd->wh = ptaCreate(10);

Error: CPPCHECK_WARNING (CWE-476): [#def1265]
leptonica-1.87.0/src/pdfio2.c:2536: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lpd
# 2534|       if (title) lpd->title = stringNew(title);
# 2535|       lpd->cida = ptraCreate(10);
# 2536|->     lpd->xy = ptaCreate(10);
# 2537|       lpd->wh = ptaCreate(10);
# 2538|       lpd->saprex = sarrayCreate(10);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1266]
leptonica-1.87.0/src/pdfio2.c:2536:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lpd’
leptonica-1.87.0/src/pdfio2.c:2533:25: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2534:8: branch_false: following ‘false’ branch (when ‘title’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:2535:17: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2536:15: throw: if ‘ptaCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2536:15: danger: ‘lpd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/0)
# 2534|       if (title) lpd->title = stringNew(title);
# 2535|       lpd->cida = ptraCreate(10);
# 2536|->     lpd->xy = ptaCreate(10);
# 2537|       lpd->wh = ptaCreate(10);
# 2538|       lpd->saprex = sarrayCreate(10);

Error: CPPCHECK_WARNING (CWE-476): [#def1267]
leptonica-1.87.0/src/pdfio2.c:2537: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lpd
# 2535|       lpd->cida = ptraCreate(10);
# 2536|       lpd->xy = ptaCreate(10);
# 2537|->     lpd->wh = ptaCreate(10);
# 2538|       lpd->saprex = sarrayCreate(10);
# 2539|       lpd->sacmap = sarrayCreate(10);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1268]
leptonica-1.87.0/src/pdfio2.c:2537:15: warning[-Wanalyzer-malloc-leak]: leak of ‘lpd’
leptonica-1.87.0/src/pdfio2.c:2533:25: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2534:8: branch_false: following ‘false’ branch (when ‘title’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:2535:17: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2537:15: throw: if ‘ptaCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2537:15: danger: ‘lpd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/0)
# 2535|       lpd->cida = ptraCreate(10);
# 2536|       lpd->xy = ptaCreate(10);
# 2537|->     lpd->wh = ptaCreate(10);
# 2538|       lpd->saprex = sarrayCreate(10);
# 2539|       lpd->sacmap = sarrayCreate(10);

Error: CPPCHECK_WARNING (CWE-476): [#def1269]
leptonica-1.87.0/src/pdfio2.c:2538: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lpd
# 2536|       lpd->xy = ptaCreate(10);
# 2537|       lpd->wh = ptaCreate(10);
# 2538|->     lpd->saprex = sarrayCreate(10);
# 2539|       lpd->sacmap = sarrayCreate(10);
# 2540|       lpd->objsize = l_dnaCreate(20);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1270]
leptonica-1.87.0/src/pdfio2.c:2538:19: warning[-Wanalyzer-malloc-leak]: leak of ‘lpd’
leptonica-1.87.0/src/pdfio2.c:2533:25: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2534:8: branch_false: following ‘false’ branch (when ‘title’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:2535:17: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2538:19: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2538:19: danger: ‘lpd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/0)
# 2536|       lpd->xy = ptaCreate(10);
# 2537|       lpd->wh = ptaCreate(10);
# 2538|->     lpd->saprex = sarrayCreate(10);
# 2539|       lpd->sacmap = sarrayCreate(10);
# 2540|       lpd->objsize = l_dnaCreate(20);

Error: CPPCHECK_WARNING (CWE-476): [#def1271]
leptonica-1.87.0/src/pdfio2.c:2539: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lpd
# 2537|       lpd->wh = ptaCreate(10);
# 2538|       lpd->saprex = sarrayCreate(10);
# 2539|->     lpd->sacmap = sarrayCreate(10);
# 2540|       lpd->objsize = l_dnaCreate(20);
# 2541|       lpd->objloc = l_dnaCreate(20);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1272]
leptonica-1.87.0/src/pdfio2.c:2539:19: warning[-Wanalyzer-malloc-leak]: leak of ‘lpd’
leptonica-1.87.0/src/pdfio2.c:2533:25: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2534:8: branch_false: following ‘false’ branch (when ‘title’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:2535:17: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2539:19: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2539:19: danger: ‘lpd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/0)
# 2537|       lpd->wh = ptaCreate(10);
# 2538|       lpd->saprex = sarrayCreate(10);
# 2539|->     lpd->sacmap = sarrayCreate(10);
# 2540|       lpd->objsize = l_dnaCreate(20);
# 2541|       lpd->objloc = l_dnaCreate(20);

Error: CPPCHECK_WARNING (CWE-476): [#def1273]
leptonica-1.87.0/src/pdfio2.c:2540: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lpd
# 2538|       lpd->saprex = sarrayCreate(10);
# 2539|       lpd->sacmap = sarrayCreate(10);
# 2540|->     lpd->objsize = l_dnaCreate(20);
# 2541|       lpd->objloc = l_dnaCreate(20);
# 2542|       return lpd;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1274]
leptonica-1.87.0/src/pdfio2.c:2540:20: warning[-Wanalyzer-malloc-leak]: leak of ‘lpd’
leptonica-1.87.0/src/pdfio2.c:2533:25: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2534:8: branch_false: following ‘false’ branch (when ‘title’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:2535:17: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2540:20: throw: if ‘l_dnaCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2540:20: danger: ‘lpd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/0)
# 2538|       lpd->saprex = sarrayCreate(10);
# 2539|       lpd->sacmap = sarrayCreate(10);
# 2540|->     lpd->objsize = l_dnaCreate(20);
# 2541|       lpd->objloc = l_dnaCreate(20);
# 2542|       return lpd;

Error: CPPCHECK_WARNING (CWE-476): [#def1275]
leptonica-1.87.0/src/pdfio2.c:2541: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lpd
# 2539|       lpd->sacmap = sarrayCreate(10);
# 2540|       lpd->objsize = l_dnaCreate(20);
# 2541|->     lpd->objloc = l_dnaCreate(20);
# 2542|       return lpd;
# 2543|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1276]
leptonica-1.87.0/src/pdfio2.c:2541:19: warning[-Wanalyzer-malloc-leak]: leak of ‘lpd’
leptonica-1.87.0/src/pdfio2.c:2533:25: acquire_memory: allocated here
leptonica-1.87.0/src/pdfio2.c:2534:8: branch_false: following ‘false’ branch (when ‘title’ is NULL)...
leptonica-1.87.0/src/pdfio2.c:2535:17: branch_false: ...to here
leptonica-1.87.0/src/pdfio2.c:2541:19: throw: if ‘l_dnaCreate’ throws an exception...
leptonica-1.87.0/src/pdfio2.c:2541:19: danger: ‘lpd’ leaks here; was allocated at [(1)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/0)
# 2539|       lpd->sacmap = sarrayCreate(10);
# 2540|       lpd->objsize = l_dnaCreate(20);
# 2541|->     lpd->objloc = l_dnaCreate(20);
# 2542|       return lpd;
# 2543|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1277]
leptonica-1.87.0/src/pix1.c:1060:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixd’
leptonica-1.87.0/src/pix1.c:495:1: enter_function: entry to ‘pixCreateHeader’
leptonica-1.87.0/src/pix1.c:507:8: branch_false: following ‘false’ branch (when ‘width > 0’)...
leptonica-1.87.0/src/pix1.c:509:8: branch_false: ...to here
leptonica-1.87.0/src/pix1.c:509:8: branch_false: following ‘false’ branch (when ‘height > 0’)...
leptonica-1.87.0/src/pix1.c:513:14: branch_false: ...to here
leptonica-1.87.0/src/pix1.c:514:8: branch_false: following ‘false’ branch (when ‘wpl64 <= 16777215’)...
leptonica-1.87.0/src/pix1.c:519:5: branch_false: ...to here
leptonica-1.87.0/src/pix1.c:521:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix1.c:542:24: branch_false: ...to here
leptonica-1.87.0/src/pix1.c:542:24: acquire_memory: allocated here
leptonica-1.87.0/src/pix1.c:542:8: branch_false: following ‘false’ branch (when ‘pixd’ is non-NULL)...
leptonica-1.87.0/src/pix1.c:544:5: branch_false: ...to here
leptonica-1.87.0/src/pix1.c:544:5: call_function: calling ‘pixSetWidth’ from ‘pixCreateHeader’
leptonica-1.87.0/src/pix1.c:544:5: return_function: returning to ‘pixCreateHeader’ from ‘pixSetWidth’
leptonica-1.87.0/src/pix1.c:545:5: call_function: calling ‘pixSetHeight’ from ‘pixCreateHeader’
leptonica-1.87.0/src/pix1.c:545:5: return_function: returning to ‘pixCreateHeader’ from ‘pixSetHeight’
leptonica-1.87.0/src/pix1.c:546:5: call_function: calling ‘pixSetDepth’ from ‘pixCreateHeader’
# 1058|           return ERROR_INT("pix not defined", __func__, 1);
# 1059|       if (depth < 1)
# 1060|->         return ERROR_INT("d must be >= 1", __func__, 1);
# 1061|   
# 1062|       pix->d = depth;

Error: CPPCHECK_WARNING (CWE-476): [#def1278]
leptonica-1.87.0/src/pix3.c:2363: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2361|       for (i = 0; i < 256; i++) {
# 2362|           byte = (l_uint8)i;
# 2363|->         tab[i] = (byte & 0x1) +
# 2364|                    ((byte >> 1) & 0x1) +
# 2365|                    ((byte >> 2) & 0x1) +

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1279]
leptonica-1.87.0/src/pix3.c:2363:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/pix3.c:2360:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pix3.c:2361:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/pix3.c:2362:9: branch_true: ...to here
leptonica-1.87.0/src/pix3.c:2363:9: danger: ‘tab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 2361|       for (i = 0; i < 256; i++) {
# 2362|           byte = (l_uint8)i;
# 2363|->         tab[i] = (byte & 0x1) +
# 2364|                    ((byte >> 1) & 0x1) +
# 2365|                    ((byte >> 2) & 0x1) +

Error: CPPCHECK_WARNING (CWE-476): [#def1280]
leptonica-1.87.0/src/pix3.c:2400: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2398|   
# 2399|       tab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
# 2400|->     tab[0] = 0;
# 2401|       tab[1] = 7;
# 2402|       for (i = 2; i < 4; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def1281]
leptonica-1.87.0/src/pix3.c:2401: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2399|       tab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
# 2400|       tab[0] = 0;
# 2401|->     tab[1] = 7;
# 2402|       for (i = 2; i < 4; i++) {
# 2403|           tab[i] = tab[i - 2] + 6;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1282]
leptonica-1.87.0/src/pix3.c:2401:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/pix3.c:2399:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pix3.c:2401:5: danger: ‘tab’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 2399|       tab = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
# 2400|       tab[0] = 0;
# 2401|->     tab[1] = 7;
# 2402|       for (i = 2; i < 4; i++) {
# 2403|           tab[i] = tab[i - 2] + 6;

Error: CPPCHECK_WARNING (CWE-476): [#def1283]
leptonica-1.87.0/src/pix3.c:2403: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2401|       tab[1] = 7;
# 2402|       for (i = 2; i < 4; i++) {
# 2403|->         tab[i] = tab[i - 2] + 6;
# 2404|       }
# 2405|       for (i = 4; i < 8; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def1284]
leptonica-1.87.0/src/pix3.c:2406: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2404|       }
# 2405|       for (i = 4; i < 8; i++) {
# 2406|->         tab[i] = tab[i - 4] + 5;
# 2407|       }
# 2408|       for (i = 8; i < 16; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def1285]
leptonica-1.87.0/src/pix3.c:2409: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2407|       }
# 2408|       for (i = 8; i < 16; i++) {
# 2409|->         tab[i] = tab[i - 8] + 4;
# 2410|       }
# 2411|       for (i = 16; i < 32; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def1286]
leptonica-1.87.0/src/pix3.c:2412: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2410|       }
# 2411|       for (i = 16; i < 32; i++) {
# 2412|->         tab[i] = tab[i - 16] + 3;
# 2413|       }
# 2414|       for (i = 32; i < 64; i++) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1287]
leptonica-1.87.0/src/pix4.c:1748:34: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘meansq’
leptonica-1.87.0/src/pix4.c:1695:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:1697:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1700:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:1702:10: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1704:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:1706:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1717:17: branch_true: following ‘true’ branch (when ‘i < hd’)...
leptonica-1.87.0/src/pix4.c:1718:25: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:1721:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:1733:17: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1733:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:1745:16: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1745:16: branch_false: following ‘false’ branch (when ‘type != 1’)...
leptonica-1.87.0/src/pix4.c:1747:21: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1747:21: branch_true: following ‘true’ branch (when ‘type == 5’)...
leptonica-1.87.0/src/pix4.c:1748:34: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:1748:34: danger: use of uninitialized value ‘meansq’ here
# 1746|                   valt = (l_int32)(ave + 0.5);
# 1747|               else if (type == L_ROOT_MEAN_SQUARE)
# 1748|->                 valt = (l_int32)(sqrt(meansq) + 0.5);
# 1749|               else  /* type == L_STANDARD_DEVIATION */
# 1750|                   valt = (l_int32)(sqrt(meansq - ave * ave) + 0.5);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1288]
leptonica-1.87.0/src/pix4.c:1750:48: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ave’
leptonica-1.87.0/src/pix4.c:1695:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:1697:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1700:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:1702:10: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1704:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:1706:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1717:17: branch_true: following ‘true’ branch (when ‘i < hd’)...
leptonica-1.87.0/src/pix4.c:1718:25: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:1721:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:1733:17: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1733:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:1745:16: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1745:16: branch_false: following ‘false’ branch (when ‘type != 1’)...
leptonica-1.87.0/src/pix4.c:1747:21: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1747:21: branch_false: following ‘false’ branch (when ‘type != 5’)...
leptonica-1.87.0/src/pix4.c:1750:48: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:1750:48: danger: use of uninitialized value ‘ave’ here
# 1748|                   valt = (l_int32)(sqrt(meansq) + 0.5);
# 1749|               else  /* type == L_STANDARD_DEVIATION */
# 1750|->                 valt = (l_int32)(sqrt(meansq - ave * ave) + 0.5);
# 1751|               SET_DATA_BYTE(lined, j, valt);
# 1752|           }

Error: COMPILER_WARNING (CWE-457): [#def1289]
leptonica-1.87.0/src/pix4.c: scope_hint: In function ‘pixGetAverageTiled’
leptonica-1.87.0/src/pix4.c:1750:52: warning[-Wmaybe-uninitialized]: ‘ave’ may be used uninitialized
# 1750 |                 valt = (l_int32)(sqrt(meansq - ave * ave) + 0.5);
#      |                                                ~~~~^~~~~
leptonica-1.87.0/src/pix4.c:1692:27: note: ‘ave’ was declared here
# 1692 | l_float64  sumave, summs, ave, meansq, normfact;
#      |                           ^~~
# 1748|                   valt = (l_int32)(sqrt(meansq) + 0.5);
# 1749|               else  /* type == L_STANDARD_DEVIATION */
# 1750|->                 valt = (l_int32)(sqrt(meansq - ave * ave) + 0.5);
# 1751|               SET_DATA_BYTE(lined, j, valt);
# 1752|           }

Error: CPPCHECK_WARNING (CWE-476): [#def1290]
leptonica-1.87.0/src/pix4.c:1839: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: famean
# 1837|                   sumsq += val * val;
# 1838|               }
# 1839|->             famean[i] = norm * sum;
# 1840|               fameansq[i] = norm * sumsq;
# 1841|               if (pnavar || pnarootvar) {

Error: CPPCHECK_WARNING (CWE-476): [#def1291]
leptonica-1.87.0/src/pix4.c:1840: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fameansq
# 1838|               }
# 1839|               famean[i] = norm * sum;
# 1840|->             fameansq[i] = norm * sumsq;
# 1841|               if (pnavar || pnarootvar) {
# 1842|                   favar[i] = fameansq[i] - famean[i] * famean[i];

Error: CPPCHECK_WARNING (CWE-476): [#def1292]
leptonica-1.87.0/src/pix4.c:1877: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: histo
# 1875|           for (i = ystart; i < yend; i++) {
# 1876|               lines = datas + i * wpls;
# 1877|->             memset(histo, 0, 1024);
# 1878|               for (j = xstart; j < xend; j++) {
# 1879|                   val = GET_DATA_BYTE(lines, j);

Error: CPPCHECK_WARNING (CWE-476): [#def1293]
leptonica-1.87.0/src/pix4.c:1996: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: famean
# 1994|                   sumsq += val * val;
# 1995|               }
# 1996|->             famean[j] = norm * sum;
# 1997|               fameansq[j] = norm * sumsq;
# 1998|               if (pnavar || pnarootvar) {

Error: CPPCHECK_WARNING (CWE-476): [#def1294]
leptonica-1.87.0/src/pix4.c:1997: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: fameansq
# 1995|               }
# 1996|               famean[j] = norm * sum;
# 1997|->             fameansq[j] = norm * sumsq;
# 1998|               if (pnavar || pnarootvar) {
# 1999|                   favar[j] = fameansq[j] - famean[j] * famean[j];

Error: CPPCHECK_WARNING (CWE-476): [#def1295]
leptonica-1.87.0/src/pix4.c:2033: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: histo
# 2031|           }
# 2032|           for (j = xstart; j < xend; j++) {
# 2033|->             memset(histo, 0, 1024);
# 2034|               for (i = ystart, lines = datas; i < yend; lines += wpls, i++) {
# 2035|                   val = GET_DATA_BYTE(lines, j);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1296]
leptonica-1.87.0/src/pix4.c:2235:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pgrayval’
leptonica-1.87.0/src/pix4.c:2089:1: enter_function: entry to ‘pixGetRangeValues’
leptonica-1.87.0/src/pix4.c:2100:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2102:8: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2102:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:2105:12: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2106:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2110:8: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2110:8: branch_false: following ‘false’ branch (when ‘factor > 0’)...
leptonica-1.87.0/src/pix4.c:2112:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2113:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2116:8: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2116:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2121:15: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2121:15: branch_true: following ‘true’ branch (when ‘color == 1’)...
leptonica-1.87.0/src/pix4.c:2122:9: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:2122:9: call_function: calling ‘pixGetExtremeValue’ from ‘pixGetRangeValues’
# 2233|               }
# 2234|           }
# 2235|->         *pgrayval = extval;
# 2236|           return 0;
# 2237|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1297]
leptonica-1.87.0/src/pix4.c:2736:5: warning[-Wanalyzer-malloc-leak]: leak of ‘carray’
leptonica-1.87.0/src/pix4.c:2661:8: branch_false: following ‘false’ branch (when ‘pcarray’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:2663:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2664:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2666:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2672:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2676:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2679:8: branch_false: following ‘false’ branch (when ‘avepts > 4’)...
leptonica-1.87.0/src/pix4.c:2692:13: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2725:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2732:26: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2732:26: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:2736:5: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/pix4.c:2736:5: danger: ‘carray’ leaks here; was allocated at [(13)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/12)
# 2734|       bincount = 0;
# 2735|       binindex = 0;
# 2736|->     numaGetIValue(naeach, 0, &binsize);
# 2737|       for (i = 0; i < 256; i++) {
# 2738|           count = l_dnaaGetDnaCount(daa, i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1298]
leptonica-1.87.0/src/pix4.c:2738:17: warning[-Wanalyzer-malloc-leak]: leak of ‘carray’
leptonica-1.87.0/src/pix4.c:2661:8: branch_false: following ‘false’ branch (when ‘pcarray’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:2663:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2664:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2666:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2672:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2676:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2679:8: branch_false: following ‘false’ branch (when ‘avepts > 4’)...
leptonica-1.87.0/src/pix4.c:2692:13: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2725:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2732:26: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2732:26: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:2737:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/pix4.c:2738:17: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:2738:17: throw: if ‘l_dnaaGetDnaCount’ throws an exception...
leptonica-1.87.0/src/pix4.c:2738:17: danger: ‘carray’ leaks here; was allocated at [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
# 2736|       numaGetIValue(naeach, 0, &binsize);
# 2737|       for (i = 0; i < 256; i++) {
# 2738|->         count = l_dnaaGetDnaCount(daa, i);
# 2739|           for (j = 0; j < count; j++) {
# 2740|               bincount++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1299]
leptonica-1.87.0/src/pix4.c:2741:13: warning[-Wanalyzer-malloc-leak]: leak of ‘carray’
leptonica-1.87.0/src/pix4.c:2661:8: branch_false: following ‘false’ branch (when ‘pcarray’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:2663:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2664:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2666:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2672:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2676:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2679:8: branch_false: following ‘false’ branch (when ‘avepts > 4’)...
leptonica-1.87.0/src/pix4.c:2692:13: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2725:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2732:26: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2732:26: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:2737:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/pix4.c:2738:17: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:2739:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:2740:13: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:2741:13: throw: if ‘l_dnaaGetValue’ throws an exception...
leptonica-1.87.0/src/pix4.c:2741:13: danger: ‘carray’ leaks here; was allocated at [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
# 2739|           for (j = 0; j < count; j++) {
# 2740|               bincount++;
# 2741|->             l_dnaaGetValue(daa, i, j, &val64);
# 2742|               extractRGBValues((l_uint32)val64, &rval, &gval, &bval);
# 2743|               rsum += rval;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1300]
leptonica-1.87.0/src/pix4.c:2742:13: warning[-Wanalyzer-malloc-leak]: leak of ‘carray’
leptonica-1.87.0/src/pix4.c:2661:8: branch_false: following ‘false’ branch (when ‘pcarray’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:2663:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2664:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2666:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2672:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2676:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2679:8: branch_false: following ‘false’ branch (when ‘avepts > 4’)...
leptonica-1.87.0/src/pix4.c:2692:13: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2725:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2732:26: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2732:26: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:2737:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/pix4.c:2738:17: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:2739:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:2740:13: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:2742:13: throw: if ‘extractRGBValues’ throws an exception...
leptonica-1.87.0/src/pix4.c:2742:13: danger: ‘carray’ leaks here; was allocated at [(13)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/12)
# 2740|               bincount++;
# 2741|               l_dnaaGetValue(daa, i, j, &val64);
# 2742|->             extractRGBValues((l_uint32)val64, &rval, &gval, &bval);
# 2743|               rsum += rval;
# 2744|               gsum += gval;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1301]
leptonica-1.87.0/src/pix4.c:2750:17: warning[-Wanalyzer-malloc-leak]: leak of ‘carray’
leptonica-1.87.0/src/pix4.c:2661:8: branch_false: following ‘false’ branch (when ‘pcarray’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:2663:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2664:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2666:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2672:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2676:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2679:8: branch_false: following ‘false’ branch (when ‘avepts > 4’)...
leptonica-1.87.0/src/pix4.c:2692:13: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2725:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:2732:26: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:2732:26: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:2737:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/pix4.c:2738:17: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:2739:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:2740:13: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:2746:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:2747:34: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:2750:17: throw: if ‘composeRGBPixel’ throws an exception...
leptonica-1.87.0/src/pix4.c:2750:17: danger: ‘carray’ leaks here; was allocated at [(13)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/12)
# 2748|                   gave = (l_int32)(gsum / binsize + 0.5);
# 2749|                   bave = (l_int32)(bsum / binsize + 0.5);
# 2750|->                 composeRGBPixel(rave, gave, bave, carray + binindex);
# 2751|                   rsum = gsum = bsum = 0.0;
# 2752|                   bincount = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1302]
leptonica-1.87.0/src/pix4.c:3047:18: warning[-Wanalyzer-malloc-leak]: leak of ‘colvect’
leptonica-1.87.0/src/pix4.c:2992:1: enter_function: entry to ‘pixaGetAlignedStats’
leptonica-1.87.0/src/pix4.c:3001:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:3003:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3003:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3006:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3009:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3010:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3013:12: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3015:28: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:3016:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:3017:9: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:3017:9: call_function: calling ‘pixaExtractColumnFromEachPix’ from ‘pixaGetAlignedStats’
# 3045|       if (!pixa)
# 3046|           return ERROR_INT("pixa not defined", __func__, 1);
# 3047|->     if (!pixd || pixGetDepth(pixd) != 8)
# 3048|           return ERROR_INT("pixd not defined or not 8 bpp", __func__, 1);
# 3049|       n = pixaGetCount(pixa);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1303]
leptonica-1.87.0/src/pix4.c:3048:16: warning[-Wanalyzer-malloc-leak]: leak of ‘colvect’
leptonica-1.87.0/src/pix4.c:2992:1: enter_function: entry to ‘pixaGetAlignedStats’
leptonica-1.87.0/src/pix4.c:3001:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:3003:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3003:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3006:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3009:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3010:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3013:12: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3015:28: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:3016:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:3017:9: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:3017:9: call_function: calling ‘pixaExtractColumnFromEachPix’ from ‘pixaGetAlignedStats’
# 3046|           return ERROR_INT("pixa not defined", __func__, 1);
# 3047|       if (!pixd || pixGetDepth(pixd) != 8)
# 3048|->         return ERROR_INT("pixd not defined or not 8 bpp", __func__, 1);
# 3049|       n = pixaGetCount(pixa);
# 3050|       pixGetDimensions(pixd, &w, &h, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1304]
leptonica-1.87.0/src/pix4.c:3049:9: warning[-Wanalyzer-malloc-leak]: leak of ‘colvect’
leptonica-1.87.0/src/pix4.c:2992:1: enter_function: entry to ‘pixaGetAlignedStats’
leptonica-1.87.0/src/pix4.c:3001:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:3003:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3003:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3006:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3009:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3010:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3013:12: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3015:28: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:3016:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:3017:9: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:3017:9: call_function: calling ‘pixaExtractColumnFromEachPix’ from ‘pixaGetAlignedStats’
# 3047|       if (!pixd || pixGetDepth(pixd) != 8)
# 3048|           return ERROR_INT("pixd not defined or not 8 bpp", __func__, 1);
# 3049|->     n = pixaGetCount(pixa);
# 3050|       pixGetDimensions(pixd, &w, &h, NULL);
# 3051|       if (n != w)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1305]
leptonica-1.87.0/src/pix4.c:3050:5: warning[-Wanalyzer-malloc-leak]: leak of ‘colvect’
leptonica-1.87.0/src/pix4.c:2992:1: enter_function: entry to ‘pixaGetAlignedStats’
leptonica-1.87.0/src/pix4.c:3001:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:3003:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3003:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3006:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3009:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3010:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3013:12: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3015:28: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:3016:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:3017:9: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:3017:9: call_function: calling ‘pixaExtractColumnFromEachPix’ from ‘pixaGetAlignedStats’
# 3048|           return ERROR_INT("pixd not defined or not 8 bpp", __func__, 1);
# 3049|       n = pixaGetCount(pixa);
# 3050|->     pixGetDimensions(pixd, &w, &h, NULL);
# 3051|       if (n != w)
# 3052|           return ERROR_INT("pix width != n", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1306]
leptonica-1.87.0/src/pix4.c:3052:16: warning[-Wanalyzer-malloc-leak]: leak of ‘colvect’
leptonica-1.87.0/src/pix4.c:2992:1: enter_function: entry to ‘pixaGetAlignedStats’
leptonica-1.87.0/src/pix4.c:3001:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:3003:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3003:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3006:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3009:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3010:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3013:12: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3015:28: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:3016:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:3017:9: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:3017:9: call_function: calling ‘pixaExtractColumnFromEachPix’ from ‘pixaGetAlignedStats’
# 3050|       pixGetDimensions(pixd, &w, &h, NULL);
# 3051|       if (n != w)
# 3052|->         return ERROR_INT("pix width != n", __func__, 1);
# 3053|       pixt = pixaGetPix(pixa, 0, L_CLONE);
# 3054|       wplt = pixGetWpl(pixt);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1307]
leptonica-1.87.0/src/pix4.c:3053:12: warning[-Wanalyzer-malloc-leak]: leak of ‘colvect’
leptonica-1.87.0/src/pix4.c:2992:1: enter_function: entry to ‘pixaGetAlignedStats’
leptonica-1.87.0/src/pix4.c:3001:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:3003:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3003:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3006:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3009:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3010:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3013:12: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3015:28: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:3016:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:3017:9: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:3017:9: call_function: calling ‘pixaExtractColumnFromEachPix’ from ‘pixaGetAlignedStats’
# 3051|       if (n != w)
# 3052|           return ERROR_INT("pix width != n", __func__, 1);
# 3053|->     pixt = pixaGetPix(pixa, 0, L_CLONE);
# 3054|       wplt = pixGetWpl(pixt);
# 3055|       pixGetDimensions(pixt, NULL, &ht, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1308]
leptonica-1.87.0/src/pix4.c:3054:12: warning[-Wanalyzer-malloc-leak]: leak of ‘colvect’
leptonica-1.87.0/src/pix4.c:2992:1: enter_function: entry to ‘pixaGetAlignedStats’
leptonica-1.87.0/src/pix4.c:3001:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:3003:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3003:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3006:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3009:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3010:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3013:12: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3015:28: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:3016:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:3017:9: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:3017:9: call_function: calling ‘pixaExtractColumnFromEachPix’ from ‘pixaGetAlignedStats’
# 3052|           return ERROR_INT("pix width != n", __func__, 1);
# 3053|       pixt = pixaGetPix(pixa, 0, L_CLONE);
# 3054|->     wplt = pixGetWpl(pixt);
# 3055|       pixGetDimensions(pixt, NULL, &ht, NULL);
# 3056|       pixDestroy(&pixt);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1309]
leptonica-1.87.0/src/pix4.c:3055:5: warning[-Wanalyzer-malloc-leak]: leak of ‘colvect’
leptonica-1.87.0/src/pix4.c:2992:1: enter_function: entry to ‘pixaGetAlignedStats’
leptonica-1.87.0/src/pix4.c:3001:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:3003:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3003:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3006:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3009:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3010:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3013:12: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3015:28: acquire_memory: allocated here
leptonica-1.87.0/src/pix4.c:3016:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pix4.c:3017:9: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:3017:9: call_function: calling ‘pixaExtractColumnFromEachPix’ from ‘pixaGetAlignedStats’
# 3053|       pixt = pixaGetPix(pixa, 0, L_CLONE);
# 3054|       wplt = pixGetWpl(pixt);
# 3055|->     pixGetDimensions(pixt, NULL, &ht, NULL);
# 3056|       pixDestroy(&pixt);
# 3057|       if (h != ht)

Error: CPPCHECK_WARNING (CWE-476): [#def1310]
leptonica-1.87.0/src/pix4.c:3149: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gray2bin
# 3147|       bin2gray = (l_int32 *)LEPT_CALLOC(nbins, sizeof(l_int32));
# 3148|       for (i = 0; i < 256; i++)  /* gray value --> histo bin */
# 3149|->         gray2bin[i] = (i * nbins) / 256;
# 3150|       for (i = 0; i < nbins; i++)  /* histo bin --> gray value */
# 3151|           bin2gray[i] = (i * 256 + 128) / nbins;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1311]
leptonica-1.87.0/src/pix4.c:3149:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘gray2bin’
leptonica-1.87.0/src/pix4.c:3122:8: branch_false: following ‘false’ branch (when ‘colvect’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:3124:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3124:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3127:8: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3127:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3129:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3133:8: branch_false: following ‘false’ branch (when ‘type != 1’)...
leptonica-1.87.0/src/pix4.c:3145:24: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3146:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pix4.c:3148:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/pix4.c:3149:23: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:3149:9: danger: ‘gray2bin + (long unsigned int)i * 4’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/8)
# 3147|       bin2gray = (l_int32 *)LEPT_CALLOC(nbins, sizeof(l_int32));
# 3148|       for (i = 0; i < 256; i++)  /* gray value --> histo bin */
# 3149|->         gray2bin[i] = (i * nbins) / 256;
# 3150|       for (i = 0; i < nbins; i++)  /* histo bin --> gray value */
# 3151|           bin2gray[i] = (i * 256 + 128) / nbins;

Error: CPPCHECK_WARNING (CWE-476): [#def1312]
leptonica-1.87.0/src/pix4.c:3151: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bin2gray
# 3149|           gray2bin[i] = (i * nbins) / 256;
# 3150|       for (i = 0; i < nbins; i++)  /* histo bin --> gray value */
# 3151|->         bin2gray[i] = (i * 256 + 128) / nbins;
# 3152|   
# 3153|       for (i = 0; i < h; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def1313]
leptonica-1.87.0/src/pix4.c:3156: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: histo
# 3154|           lines = datas + i * wpls;
# 3155|           for (k = 0; k < nbins; k++)
# 3156|->             histo[k] = 0;
# 3157|           for (j = 0; j < w; j++) {
# 3158|               val = GET_DATA_BYTE(lines, j);

Error: CPPCHECK_WARNING (CWE-476): [#def1314]
leptonica-1.87.0/src/pix4.c:3268: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gray2bin
# 3266|       bin2gray = (l_int32 *)LEPT_CALLOC(nbins, sizeof(l_int32));
# 3267|       for (i = 0; i < 256; i++)  /* gray value --> histo bin */
# 3268|->         gray2bin[i] = (i * nbins) / 256;
# 3269|       for (i = 0; i < nbins; i++)  /* histo bin --> gray value */
# 3270|           bin2gray[i] = (i * 256 + 128) / nbins;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1315]
leptonica-1.87.0/src/pix4.c:3268:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘gray2bin’
leptonica-1.87.0/src/pix4.c:3240:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3242:8: branch_false: following ‘false’ branch (when ‘rowvect’ is non-NULL)...
leptonica-1.87.0/src/pix4.c:3244:9: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3244:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3247:8: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3247:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pix4.c:3249:5: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3253:8: branch_false: following ‘false’ branch (when ‘type != 1’)...
leptonica-1.87.0/src/pix4.c:3264:24: branch_false: ...to here
leptonica-1.87.0/src/pix4.c:3265:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pix4.c:3267:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/pix4.c:3268:23: branch_true: ...to here
leptonica-1.87.0/src/pix4.c:3268:9: danger: ‘gray2bin + (long unsigned int)i * 4’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/10)
# 3266|       bin2gray = (l_int32 *)LEPT_CALLOC(nbins, sizeof(l_int32));
# 3267|       for (i = 0; i < 256; i++)  /* gray value --> histo bin */
# 3268|->         gray2bin[i] = (i * nbins) / 256;
# 3269|       for (i = 0; i < nbins; i++)  /* histo bin --> gray value */
# 3270|           bin2gray[i] = (i * 256 + 128) / nbins;

Error: CPPCHECK_WARNING (CWE-476): [#def1316]
leptonica-1.87.0/src/pix4.c:3270: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: bin2gray
# 3268|           gray2bin[i] = (i * nbins) / 256;
# 3269|       for (i = 0; i < nbins; i++)  /* histo bin --> gray value */
# 3270|->         bin2gray[i] = (i * 256 + 128) / nbins;
# 3271|   
# 3272|       for (j = 0; j < w; j++) {

Error: CPPCHECK_WARNING (CWE-476): [#def1317]
leptonica-1.87.0/src/pix4.c:3275: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: gray2bin
# 3273|           for (i = 0; i < h; i++) {
# 3274|               val = GET_DATA_BYTE(datas + i * wpls, j);
# 3275|->             histo[gray2bin[val]]++;
# 3276|           }
# 3277|   

Error: CPPCHECK_WARNING (CWE-476): [#def1318]
leptonica-1.87.0/src/pix4.c:3275: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: histo
# 3273|           for (i = 0; i < h; i++) {
# 3274|               val = GET_DATA_BYTE(datas + i * wpls, j);
# 3275|->             histo[gray2bin[val]]++;
# 3276|           }
# 3277|   

Error: CPPCHECK_WARNING (CWE-476): [#def1319]
leptonica-1.87.0/src/pixabasic.c:175: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixa
#  173|   
#  174|       pixa = (PIXA *)LEPT_CALLOC(1, sizeof(PIXA));
#  175|->     pixa->n = 0;
#  176|       pixa->nalloc = n;
#  177|       pixa->refcount = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1320]
leptonica-1.87.0/src/pixabasic.c:175:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixa’
leptonica-1.87.0/src/pixabasic.c:2522:1: enter_function: entry to ‘pixaReadStream’
leptonica-1.87.0/src/pixabasic.c:2537:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2539:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2539:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2541:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2541:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2543:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2543:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2545:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2547:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2551:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2551:17: call_function: calling ‘pixaCreate’ from ‘pixaReadStream’
#  173|   
#  174|       pixa = (PIXA *)LEPT_CALLOC(1, sizeof(PIXA));
#  175|->     pixa->n = 0;
#  176|       pixa->nalloc = n;
#  177|       pixa->refcount = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def1321]
leptonica-1.87.0/src/pixabasic.c:176: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixa
#  174|       pixa = (PIXA *)LEPT_CALLOC(1, sizeof(PIXA));
#  175|       pixa->n = 0;
#  176|->     pixa->nalloc = n;
#  177|       pixa->refcount = 1;
#  178|       pixa->pix = (PIX **)LEPT_CALLOC(n, sizeof(PIX *));

Error: CPPCHECK_WARNING (CWE-476): [#def1322]
leptonica-1.87.0/src/pixabasic.c:177: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixa
#  175|       pixa->n = 0;
#  176|       pixa->nalloc = n;
#  177|->     pixa->refcount = 1;
#  178|       pixa->pix = (PIX **)LEPT_CALLOC(n, sizeof(PIX *));
#  179|       pixa->boxa = boxaCreate(n);

Error: CPPCHECK_WARNING (CWE-476): [#def1323]
leptonica-1.87.0/src/pixabasic.c:178: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixa
#  176|       pixa->nalloc = n;
#  177|       pixa->refcount = 1;
#  178|->     pixa->pix = (PIX **)LEPT_CALLOC(n, sizeof(PIX *));
#  179|       pixa->boxa = boxaCreate(n);
#  180|       if (!pixa->pix || !pixa->boxa) {

Error: CPPCHECK_WARNING (CWE-476): [#def1324]
leptonica-1.87.0/src/pixabasic.c:179: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixa
#  177|       pixa->refcount = 1;
#  178|       pixa->pix = (PIX **)LEPT_CALLOC(n, sizeof(PIX *));
#  179|->     pixa->boxa = boxaCreate(n);
#  180|       if (!pixa->pix || !pixa->boxa) {
#  181|           pixaDestroy(&pixa);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1325]
leptonica-1.87.0/src/pixabasic.c:179:18: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/pixabasic.c:2522:1: enter_function: entry to ‘pixaReadStream’
leptonica-1.87.0/src/pixabasic.c:2537:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2539:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2539:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2541:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2541:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2543:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2543:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2545:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2547:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2551:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2551:17: call_function: calling ‘pixaCreate’ from ‘pixaReadStream’
#  177|       pixa->refcount = 1;
#  178|       pixa->pix = (PIX **)LEPT_CALLOC(n, sizeof(PIX *));
#  179|->     pixa->boxa = boxaCreate(n);
#  180|       if (!pixa->pix || !pixa->boxa) {
#  181|           pixaDestroy(&pixa);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1326]
leptonica-1.87.0/src/pixabasic.c:179:18: warning[-Wanalyzer-malloc-leak]: leak of ‘pixa’
leptonica-1.87.0/src/pixabasic.c:2522:1: enter_function: entry to ‘pixaReadStream’
leptonica-1.87.0/src/pixabasic.c:2537:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2539:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2539:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2541:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2541:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2543:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2543:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2545:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2547:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2551:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2551:17: call_function: calling ‘pixaCreate’ from ‘pixaReadStream’
#  177|       pixa->refcount = 1;
#  178|       pixa->pix = (PIX **)LEPT_CALLOC(n, sizeof(PIX *));
#  179|->     pixa->boxa = boxaCreate(n);
#  180|       if (!pixa->pix || !pixa->boxa) {
#  181|           pixaDestroy(&pixa);

Error: CPPCHECK_WARNING (CWE-476): [#def1327]
leptonica-1.87.0/src/pixabasic.c:180: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixa
#  178|       pixa->pix = (PIX **)LEPT_CALLOC(n, sizeof(PIX *));
#  179|       pixa->boxa = boxaCreate(n);
#  180|->     if (!pixa->pix || !pixa->boxa) {
#  181|           pixaDestroy(&pixa);
#  182|           return (PIXA *)ERROR_PTR("pix or boxa not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1328]
leptonica-1.87.0/src/pixabasic.c:422:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixa’
leptonica-1.87.0/src/pixabasic.c:2522:1: enter_function: entry to ‘pixaReadStream’
leptonica-1.87.0/src/pixabasic.c:2537:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2539:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2539:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2541:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2541:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2543:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2543:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2545:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2547:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2551:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2551:17: call_function: calling ‘pixaCreate’ from ‘pixaReadStream’
#  420|               pixDestroy(&pixa->pix[i]);
#  421|           LEPT_FREE(pixa->pix);
#  422|->         boxaDestroy(&pixa->boxa);
#  423|           LEPT_FREE(pixa);
#  424|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1329]
leptonica-1.87.0/src/pixabasic.c:1762:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaaCreate(sarrayGetCount(getSortedPathnamesInDirectory(dirname,  substr,  first,  nfiles)))’
leptonica-1.87.0/src/pixabasic.c:2838:1: enter_function: entry to ‘pixaaReadFromFiles’
leptonica-1.87.0/src/pixabasic.c:2849:6: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2852:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2853:6: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2858:9: call_function: calling ‘pixaaCreate’ from ‘pixaaReadFromFiles’
leptonica-1.87.0/src/pixabasic.c:2858:9: return_function: returning to ‘pixaaReadFromFiles’ from ‘pixaaCreate’
leptonica-1.87.0/src/pixabasic.c:2859:15: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2868:3: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2868:3: throw: if ‘sarrayDestroy’ throws an exception...
leptonica-1.87.0/src/pixabasic.c:1762:9: danger: ‘pixaaCreate(sarrayGetCount(getSortedPathnamesInDirectory(dirname,  substr,  first,  nfiles)))’ leaks here; was allocated at [(8)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/7)
# 1760|   PIXAA  *paa;
# 1761|   
# 1762|->     if (n <= 0 || n > MaxInitPtrArraySize)
# 1763|           n = InitialPtrArraySize;
# 1764|   

Error: CPPCHECK_WARNING (CWE-476): [#def1330]
leptonica-1.87.0/src/pixabasic.c:1766: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: paa
# 1764|   
# 1765|       paa = (PIXAA *)LEPT_CALLOC(1, sizeof(PIXAA));
# 1766|->     paa->n = 0;
# 1767|       paa->nalloc = n;
# 1768|       if ((paa->pixa = (PIXA **)LEPT_CALLOC(n, sizeof(PIXA *))) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1331]
leptonica-1.87.0/src/pixabasic.c:1766:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘paa’
leptonica-1.87.0/src/pixabasic.c:2838:1: enter_function: entry to ‘pixaaReadFromFiles’
leptonica-1.87.0/src/pixabasic.c:2849:6: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2852:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2853:6: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2858:9: call_function: calling ‘pixaaCreate’ from ‘pixaaReadFromFiles’
# 1764|   
# 1765|       paa = (PIXAA *)LEPT_CALLOC(1, sizeof(PIXAA));
# 1766|->     paa->n = 0;
# 1767|       paa->nalloc = n;
# 1768|       if ((paa->pixa = (PIXA **)LEPT_CALLOC(n, sizeof(PIXA *))) == NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def1332]
leptonica-1.87.0/src/pixabasic.c:1767: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: paa
# 1765|       paa = (PIXAA *)LEPT_CALLOC(1, sizeof(PIXAA));
# 1766|       paa->n = 0;
# 1767|->     paa->nalloc = n;
# 1768|       if ((paa->pixa = (PIXA **)LEPT_CALLOC(n, sizeof(PIXA *))) == NULL) {
# 1769|           pixaaDestroy(&paa);

Error: CPPCHECK_WARNING (CWE-476): [#def1333]
leptonica-1.87.0/src/pixabasic.c:1768: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: paa
# 1766|       paa->n = 0;
# 1767|       paa->nalloc = n;
# 1768|->     if ((paa->pixa = (PIXA **)LEPT_CALLOC(n, sizeof(PIXA *))) == NULL) {
# 1769|           pixaaDestroy(&paa);
# 1770|           return (PIXAA *)ERROR_PTR("pixa ptrs not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def1334]
leptonica-1.87.0/src/pixabasic.c:1772: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: paa
# 1770|           return (PIXAA *)ERROR_PTR("pixa ptrs not made", __func__, NULL);
# 1771|       }
# 1772|->     paa->boxa = boxaCreate(n);
# 1773|   
# 1774|       return paa;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1335]
leptonica-1.87.0/src/pixabasic.c:1772:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/pixabasic.c:2838:1: enter_function: entry to ‘pixaaReadFromFiles’
leptonica-1.87.0/src/pixabasic.c:2849:6: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2852:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2853:6: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2858:9: call_function: calling ‘pixaaCreate’ from ‘pixaaReadFromFiles’
# 1770|           return (PIXAA *)ERROR_PTR("pixa ptrs not made", __func__, NULL);
# 1771|       }
# 1772|->     paa->boxa = boxaCreate(n);
# 1773|   
# 1774|       return paa;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1336]
leptonica-1.87.0/src/pixabasic.c:1772:17: warning[-Wanalyzer-malloc-leak]: leak of ‘paa’
leptonica-1.87.0/src/pixabasic.c:2838:1: enter_function: entry to ‘pixaaReadFromFiles’
leptonica-1.87.0/src/pixabasic.c:2849:6: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2852:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2853:6: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2858:9: call_function: calling ‘pixaaCreate’ from ‘pixaaReadFromFiles’
# 1770|           return (PIXAA *)ERROR_PTR("pixa ptrs not made", __func__, NULL);
# 1771|       }
# 1772|->     paa->boxa = boxaCreate(n);
# 1773|   
# 1774|       return paa;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1337]
leptonica-1.87.0/src/pixabasic.c:1875:5: warning[-Wanalyzer-malloc-leak]: leak of ‘paa’
leptonica-1.87.0/src/pixabasic.c:2838:1: enter_function: entry to ‘pixaaReadFromFiles’
leptonica-1.87.0/src/pixabasic.c:2849:6: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2852:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2853:6: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2858:9: call_function: calling ‘pixaaCreate’ from ‘pixaaReadFromFiles’
# 1873|           pixaDestroy(&paa->pixa[i]);
# 1874|       LEPT_FREE(paa->pixa);
# 1875|->     boxaDestroy(&paa->boxa);
# 1876|       LEPT_FREE(paa);
# 1877|       *ppaa = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1338]
leptonica-1.87.0/src/pixabasic.c:2555:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/pixabasic.c:2522:1: enter_function: entry to ‘pixaReadStream’
leptonica-1.87.0/src/pixabasic.c:2537:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2539:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2539:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2541:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2541:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2543:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2543:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2545:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2547:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2551:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2551:17: call_function: calling ‘pixaCreate’ from ‘pixaReadStream’
leptonica-1.87.0/src/pixabasic.c:2551:17: return_function: returning to ‘pixaReadStream’ from ‘pixaCreate’
leptonica-1.87.0/src/pixabasic.c:2551:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2555:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2555:5: throw: if ‘boxaDestroy’ throws an exception...
leptonica-1.87.0/src/pixabasic.c:2555:5: danger: ‘<unknown>’ leaks here; was allocated at [(16)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/15)
# 2553|           return (PIXA *)ERROR_PTR("pixa not made", __func__, NULL);
# 2554|       }
# 2555|->     boxaDestroy(&pixa->boxa);
# 2556|       pixa->boxa = boxa;
# 2557|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1339]
leptonica-1.87.0/src/pixabasic.c:2555:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pixa’
leptonica-1.87.0/src/pixabasic.c:2522:1: enter_function: entry to ‘pixaReadStream’
leptonica-1.87.0/src/pixabasic.c:2537:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2539:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2539:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2541:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2541:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2543:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2543:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2545:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2547:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2549:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2551:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2551:17: call_function: calling ‘pixaCreate’ from ‘pixaReadStream’
leptonica-1.87.0/src/pixabasic.c:2551:17: return_function: returning to ‘pixaReadStream’ from ‘pixaCreate’
leptonica-1.87.0/src/pixabasic.c:2551:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2555:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2555:5: throw: if ‘boxaDestroy’ throws an exception...
leptonica-1.87.0/src/pixabasic.c:2555:5: danger: ‘pixa’ leaks here; was allocated at [(16)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/15)
# 2553|           return (PIXA *)ERROR_PTR("pixa not made", __func__, NULL);
# 2554|       }
# 2555|->     boxaDestroy(&pixa->boxa);
# 2556|       pixa->boxa = boxa;
# 2557|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1340]
leptonica-1.87.0/src/pixabasic.c:2702:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pixabasic.c:2729:1: enter_function: entry to ‘pixaWriteMem’
leptonica-1.87.0/src/pixabasic.c:2737:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2737:16: branch_true: ...to here
leptonica-1.87.0/src/pixabasic.c:2738:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2740:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2740:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2742:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2742:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2746:15: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2746:15: acquire_memory: allocated here
leptonica-1.87.0/src/pixabasic.c:2746:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2748:11: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2748:11: call_function: calling ‘pixaWriteStream’ from ‘pixaWriteMem’
# 2700|       fprintf(fp, "\nPixa Version %d\n", PIXA_VERSION_NUMBER);
# 2701|       fprintf(fp, "Number of pix = %d\n", n);
# 2702|->     boxaWriteStream(fp, pixa->boxa);
# 2703|       for (i = 0; i < n; i++) {
# 2704|           if ((pix = pixaGetPix(pixa, i, L_CLONE)) == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1341]
leptonica-1.87.0/src/pixabasic.c:2860:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/pixabasic.c:2838:1: enter_function: entry to ‘pixaaReadFromFiles’
leptonica-1.87.0/src/pixabasic.c:2849:6: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2852:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2853:6: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2858:9: call_function: calling ‘pixaaCreate’ from ‘pixaaReadFromFiles’
leptonica-1.87.0/src/pixabasic.c:2858:9: return_function: returning to ‘pixaaReadFromFiles’ from ‘pixaaCreate’
leptonica-1.87.0/src/pixabasic.c:2859:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixabasic.c:2860:15: branch_true: ...to here
leptonica-1.87.0/src/pixabasic.c:2860:15: throw: if ‘sarrayGetString’ throws an exception...
leptonica-1.87.0/src/pixabasic.c:2860:15: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/7)
# 2858|     paa = pixaaCreate(n);
# 2859|     for (i = 0; i < n; i++) {
# 2860|->       fname = sarrayGetString(sa, i, L_NOCOPY);
# 2861|         if ((pixa = pixaRead(fname)) == NULL) {
# 2862|             L_ERROR("pixa not read for %d-th file", __func__, i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1342]
leptonica-1.87.0/src/pixabasic.c:2868:3: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/pixabasic.c:2838:1: enter_function: entry to ‘pixaaReadFromFiles’
leptonica-1.87.0/src/pixabasic.c:2849:6: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:2852:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2853:6: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2858:9: call_function: calling ‘pixaaCreate’ from ‘pixaaReadFromFiles’
leptonica-1.87.0/src/pixabasic.c:2858:9: return_function: returning to ‘pixaaReadFromFiles’ from ‘pixaaCreate’
leptonica-1.87.0/src/pixabasic.c:2859:15: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2868:3: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2868:3: throw: if ‘sarrayDestroy’ throws an exception...
leptonica-1.87.0/src/pixabasic.c:2868:3: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/7)
# 2866|     }
# 2867|   
# 2868|->   sarrayDestroy(&sa);
# 2869|     return paa;
# 2870|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1343]
leptonica-1.87.0/src/pixabasic.c:2952:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/pixabasic.c:2923:1: enter_function: entry to ‘pixaaReadStream’
leptonica-1.87.0/src/pixabasic.c:2938:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2940:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2940:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2942:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2944:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2944:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2946:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2946:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2948:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2950:16: call_function: calling ‘pixaaCreate’ from ‘pixaaReadStream’
leptonica-1.87.0/src/pixabasic.c:2950:16: return_function: returning to ‘pixaaReadStream’ from ‘pixaaCreate’
leptonica-1.87.0/src/pixabasic.c:2950:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2952:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2952:17: throw: if ‘boxaReadStream’ throws an exception...
leptonica-1.87.0/src/pixabasic.c:2952:17: danger: ‘<unknown>’ leaks here; was allocated at [(14)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/13)
# 2950|       if ((paa = pixaaCreate(n)) == NULL)
# 2951|           return (PIXAA *)ERROR_PTR("paa not made", __func__, NULL);
# 2952|->     if ((boxa = boxaReadStream(fp)) == NULL) {
# 2953|           pixaaDestroy(&paa);
# 2954|           return (PIXAA *)ERROR_PTR("boxa not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1344]
leptonica-1.87.0/src/pixabasic.c:2952:17: warning[-Wanalyzer-malloc-leak]: leak of ‘paa’
leptonica-1.87.0/src/pixabasic.c:2923:1: enter_function: entry to ‘pixaaReadStream’
leptonica-1.87.0/src/pixabasic.c:2938:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2940:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2940:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2942:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2944:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2944:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2946:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2946:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2948:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2950:16: call_function: calling ‘pixaaCreate’ from ‘pixaaReadStream’
leptonica-1.87.0/src/pixabasic.c:2950:16: return_function: returning to ‘pixaaReadStream’ from ‘pixaaCreate’
leptonica-1.87.0/src/pixabasic.c:2950:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2952:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2952:17: throw: if ‘boxaReadStream’ throws an exception...
leptonica-1.87.0/src/pixabasic.c:2952:17: danger: ‘paa’ leaks here; was allocated at [(14)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/13)
# 2950|       if ((paa = pixaaCreate(n)) == NULL)
# 2951|           return (PIXAA *)ERROR_PTR("paa not made", __func__, NULL);
# 2952|->     if ((boxa = boxaReadStream(fp)) == NULL) {
# 2953|           pixaaDestroy(&paa);
# 2954|           return (PIXAA *)ERROR_PTR("boxa not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1345]
leptonica-1.87.0/src/pixabasic.c:2956:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/pixabasic.c:2923:1: enter_function: entry to ‘pixaaReadStream’
leptonica-1.87.0/src/pixabasic.c:2938:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2940:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2940:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2942:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2944:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2944:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2946:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2946:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2948:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2950:16: call_function: calling ‘pixaaCreate’ from ‘pixaaReadStream’
leptonica-1.87.0/src/pixabasic.c:2950:16: return_function: returning to ‘pixaaReadStream’ from ‘pixaaCreate’
leptonica-1.87.0/src/pixabasic.c:2950:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2952:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2952:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2956:21: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2956:5: throw: if ‘boxaDestroy’ throws an exception...
leptonica-1.87.0/src/pixabasic.c:2956:5: danger: ‘<unknown>’ leaks here; was allocated at [(14)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/13)
# 2954|           return (PIXAA *)ERROR_PTR("boxa not made", __func__, NULL);
# 2955|       }
# 2956|->     boxaDestroy(&paa->boxa);
# 2957|       paa->boxa = boxa;
# 2958|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1346]
leptonica-1.87.0/src/pixabasic.c:2956:5: warning[-Wanalyzer-malloc-leak]: leak of ‘paa’
leptonica-1.87.0/src/pixabasic.c:2923:1: enter_function: entry to ‘pixaaReadStream’
leptonica-1.87.0/src/pixabasic.c:2938:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2940:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2940:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2942:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2942:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2944:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2944:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2946:9: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2946:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2948:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2950:16: call_function: calling ‘pixaaCreate’ from ‘pixaaReadStream’
leptonica-1.87.0/src/pixabasic.c:2950:16: return_function: returning to ‘pixaaReadStream’ from ‘pixaaCreate’
leptonica-1.87.0/src/pixabasic.c:2950:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2952:17: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2952:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixabasic.c:2956:21: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:2956:5: throw: if ‘boxaDestroy’ throws an exception...
leptonica-1.87.0/src/pixabasic.c:2956:5: danger: ‘paa’ leaks here; was allocated at [(14)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/13)
# 2954|           return (PIXAA *)ERROR_PTR("boxa not made", __func__, NULL);
# 2955|       }
# 2956|->     boxaDestroy(&paa->boxa);
# 2957|       paa->boxa = boxa;
# 2958|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1347]
leptonica-1.87.0/src/pixabasic.c:3073:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pixabasic.c:3099:1: enter_function: entry to ‘pixaaWriteMem’
leptonica-1.87.0/src/pixabasic.c:3107:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:3107:16: branch_true: ...to here
leptonica-1.87.0/src/pixabasic.c:3108:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:3110:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:3110:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:3112:8: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:3112:8: branch_false: following ‘false’ branch (when ‘paa’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:3116:15: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:3116:15: acquire_memory: allocated here
leptonica-1.87.0/src/pixabasic.c:3116:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pixabasic.c:3118:11: branch_false: ...to here
leptonica-1.87.0/src/pixabasic.c:3118:11: call_function: calling ‘pixaaWriteStream’ from ‘pixaaWriteMem’
# 3071|       fprintf(fp, "\nPixaa Version %d\n", PIXAA_VERSION_NUMBER);
# 3072|       fprintf(fp, "Number of pixa = %d\n", n);
# 3073|->     boxaWriteStream(fp, paa->boxa);
# 3074|       for (i = 0; i < n; i++) {
# 3075|           if ((pixa = pixaaGetPixa(paa, i, L_CLONE)) == NULL)

Error: CPPCHECK_WARNING (CWE-476): [#def1348]
leptonica-1.87.0/src/pixacc.c:100: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixacc
#   98|   
#   99|       pixacc = (PIXACC *)LEPT_CALLOC(1, sizeof(PIXACC));
#  100|->     pixacc->w = w;
#  101|       pixacc->h = h;
#  102|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1349]
leptonica-1.87.0/src/pixacc.c:100:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixacc’
leptonica-1.87.0/src/pixacc.c:99:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pixacc.c:100:5: danger: ‘calloc(1, 24)’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   98|   
#   99|       pixacc = (PIXACC *)LEPT_CALLOC(1, sizeof(PIXACC));
#  100|->     pixacc->w = w;
#  101|       pixacc->h = h;
#  102|   

Error: CPPCHECK_WARNING (CWE-476): [#def1350]
leptonica-1.87.0/src/pixacc.c:101: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixacc
#   99|       pixacc = (PIXACC *)LEPT_CALLOC(1, sizeof(PIXACC));
#  100|       pixacc->w = w;
#  101|->     pixacc->h = h;
#  102|   
#  103|       if ((pixacc->pix = pixCreate(w, h, 32)) == NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def1351]
leptonica-1.87.0/src/pixacc.c:103: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixacc
#  101|       pixacc->h = h;
#  102|   
#  103|->     if ((pixacc->pix = pixCreate(w, h, 32)) == NULL) {
#  104|           pixaccDestroy(&pixacc);
#  105|           return (PIXACC *)ERROR_PTR("pix not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1352]
leptonica-1.87.0/src/pixacc.c:103:24: warning[-Wanalyzer-malloc-leak]: leak of ‘pixacc’
leptonica-1.87.0/src/pixacc.c:99:24: acquire_memory: allocated here
leptonica-1.87.0/src/pixacc.c:103:24: throw: if ‘pixCreate’ throws an exception...
leptonica-1.87.0/src/pixacc.c:103:24: danger: ‘pixacc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  101|       pixacc->h = h;
#  102|   
#  103|->     if ((pixacc->pix = pixCreate(w, h, 32)) == NULL) {
#  104|           pixaccDestroy(&pixacc);
#  105|           return (PIXACC *)ERROR_PTR("pix not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1353]
leptonica-1.87.0/src/pixacc.c:109:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaccCreate(w,  h,  negflag)’
leptonica-1.87.0/src/pixacc.c:131:1: enter_function: entry to ‘pixaccCreateFromPix’
leptonica-1.87.0/src/pixacc.c:137:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pixacc.c:140:5: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:141:14: call_function: calling ‘pixaccCreate’ from ‘pixaccCreateFromPix’
leptonica-1.87.0/src/pixacc.c:141:14: return_function: returning to ‘pixaccCreateFromPix’ from ‘pixaccCreate’
leptonica-1.87.0/src/pixacc.c:142:5: call_function: calling ‘pixaccAdd’ from ‘pixaccCreateFromPix’
#  107|   
#  108|       if (negflag) {
#  109|->         pixacc->offset = 0x40000000;
#  110|           pixSetAllArbitrary(pixacc->pix, pixacc->offset);
#  111|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1354]
leptonica-1.87.0/src/pixacc.c:110:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixacc’
leptonica-1.87.0/src/pixacc.c:99:24: acquire_memory: allocated here
leptonica-1.87.0/src/pixacc.c:103:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixacc.c:108:8: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:108:8: branch_true: following ‘true’ branch (when ‘negflag != 0’)...
leptonica-1.87.0/src/pixacc.c:109:15: branch_true: ...to here
leptonica-1.87.0/src/pixacc.c:110:9: throw: if ‘pixSetAllArbitrary’ throws an exception...
leptonica-1.87.0/src/pixacc.c:110:9: danger: ‘pixacc’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  108|       if (negflag) {
#  109|           pixacc->offset = 0x40000000;
#  110|->         pixSetAllArbitrary(pixacc->pix, pixacc->offset);
#  111|       }
#  112|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1355]
leptonica-1.87.0/src/pixacc.c:113:12: warning[-Wanalyzer-malloc-leak]: leak of ‘pixaccCreate(w,  h,  negflag)’
leptonica-1.87.0/src/pixacc.c:131:1: enter_function: entry to ‘pixaccCreateFromPix’
leptonica-1.87.0/src/pixacc.c:137:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pixacc.c:140:5: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:141:14: call_function: calling ‘pixaccCreate’ from ‘pixaccCreateFromPix’
leptonica-1.87.0/src/pixacc.c:141:14: return_function: returning to ‘pixaccCreateFromPix’ from ‘pixaccCreate’
leptonica-1.87.0/src/pixacc.c:142:5: call_function: calling ‘pixaccAdd’ from ‘pixaccCreateFromPix’
#  111|       }
#  112|   
#  113|->     return pixacc;
#  114|   }
#  115|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1356]
leptonica-1.87.0/src/pixacc.c:171:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pixacc’
leptonica-1.87.0/src/pixacc.c:93:1: enter_function: entry to ‘pixaccCreate’
leptonica-1.87.0/src/pixacc.c:99:24: acquire_memory: allocated here
leptonica-1.87.0/src/pixacc.c:103:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixacc.c:104:9: branch_true: ...to here
leptonica-1.87.0/src/pixacc.c:104:9: call_function: calling ‘pixaccDestroy’ from ‘pixaccCreate’
#  169|           return;
#  170|   
#  171|->     pixDestroy(&pixacc->pix);
#  172|       LEPT_FREE(pixacc);
#  173|       *ppixacc = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1357]
leptonica-1.87.0/src/pixacc.c:194:12: warning[-Wanalyzer-malloc-leak]: leak of ‘pacct’
leptonica-1.87.0/src/pixacc.c:309:1: enter_function: entry to ‘pixaccMultConstAccumulate’
leptonica-1.87.0/src/pixacc.c:317:8: branch_false: following ‘false’ branch (when ‘pixacc’ is non-NULL)...
leptonica-1.87.0/src/pixacc.c:319:8: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:319:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pixacc.c:322:8: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:322:8: branch_false: following ‘false’ branch (when ‘factor != 0.0f’)...
leptonica-1.87.0/src/pixacc.c:324:5: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:326:13: call_function: calling ‘pixaccCreate’ from ‘pixaccMultConstAccumulate’
leptonica-1.87.0/src/pixacc.c:326:13: return_function: returning to ‘pixaccMultConstAccumulate’ from ‘pixaccCreate’
leptonica-1.87.0/src/pixacc.c:327:5: call_function: calling ‘pixaccAdd’ from ‘pixaccMultConstAccumulate’
leptonica-1.87.0/src/pixacc.c:327:5: return_function: returning to ‘pixaccMultConstAccumulate’ from ‘pixaccAdd’
leptonica-1.87.0/src/pixacc.c:328:5: call_function: calling ‘pixaccMultConst’ from ‘pixaccMultConstAccumulate’
leptonica-1.87.0/src/pixacc.c:328:5: return_function: returning to ‘pixaccMultConstAccumulate’ from ‘pixaccMultConst’
leptonica-1.87.0/src/pixacc.c:329:12: call_function: calling ‘pixaccFinal’ from ‘pixaccMultConstAccumulate’
#  192|           return (PIX *)ERROR_PTR("pixacc not defined", __func__, NULL);
#  193|   
#  194|->     return pixFinalAccumulate(pixaccGetPix(pixacc), pixaccGetOffset(pixacc),
#  195|                                 outdepth);
#  196|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1358]
leptonica-1.87.0/src/pixacc.c:250:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pacct’
leptonica-1.87.0/src/pixacc.c:309:1: enter_function: entry to ‘pixaccMultConstAccumulate’
leptonica-1.87.0/src/pixacc.c:317:8: branch_false: following ‘false’ branch (when ‘pixacc’ is non-NULL)...
leptonica-1.87.0/src/pixacc.c:319:8: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:319:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pixacc.c:322:8: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:322:8: branch_false: following ‘false’ branch (when ‘factor != 0.0f’)...
leptonica-1.87.0/src/pixacc.c:324:5: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:326:13: call_function: calling ‘pixaccCreate’ from ‘pixaccMultConstAccumulate’
leptonica-1.87.0/src/pixacc.c:326:13: return_function: returning to ‘pixaccMultConstAccumulate’ from ‘pixaccCreate’
leptonica-1.87.0/src/pixacc.c:327:5: call_function: calling ‘pixaccAdd’ from ‘pixaccMultConstAccumulate’
#  248|       if (!pix)
#  249|           return ERROR_INT("pix not defined", __func__, 1);
#  250|->     pixAccumulate(pixaccGetPix(pixacc), pix, L_ARITH_ADD);
#  251|       return 0;
#  252|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1359]
leptonica-1.87.0/src/pixacc.c:288:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pacct’
leptonica-1.87.0/src/pixacc.c:309:1: enter_function: entry to ‘pixaccMultConstAccumulate’
leptonica-1.87.0/src/pixacc.c:317:8: branch_false: following ‘false’ branch (when ‘pixacc’ is non-NULL)...
leptonica-1.87.0/src/pixacc.c:319:8: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:319:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pixacc.c:322:8: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:322:8: branch_false: following ‘false’ branch (when ‘factor != 0.0f’)...
leptonica-1.87.0/src/pixacc.c:324:5: branch_false: ...to here
leptonica-1.87.0/src/pixacc.c:326:13: call_function: calling ‘pixaccCreate’ from ‘pixaccMultConstAccumulate’
leptonica-1.87.0/src/pixacc.c:326:13: return_function: returning to ‘pixaccMultConstAccumulate’ from ‘pixaccCreate’
leptonica-1.87.0/src/pixacc.c:327:5: call_function: calling ‘pixaccAdd’ from ‘pixaccMultConstAccumulate’
leptonica-1.87.0/src/pixacc.c:327:5: return_function: returning to ‘pixaccMultConstAccumulate’ from ‘pixaccAdd’
leptonica-1.87.0/src/pixacc.c:328:5: call_function: calling ‘pixaccMultConst’ from ‘pixaccMultConstAccumulate’
#  286|       if (!pixacc)
#  287|           return ERROR_INT("pixacc not defined", __func__, 1);
#  288|->     pixMultConstAccumulate(pixaccGetPix(pixacc), factor,
#  289|                              pixaccGetOffset(pixacc));
#  290|       return 0;

Error: CPPCHECK_WARNING (CWE-457): [#def1360]
leptonica-1.87.0/src/pixafunc2.c:311: warning[uninitvar]: Uninitialized variable: res
#  309|       }
#  310|   
#  311|->     pixSetResolution(pixd, res, res);
#  312|       return pixd;
#  313|   }

Error: COMPILER_WARNING (CWE-457): [#def1361]
leptonica-1.87.0/src/pixafunc2.c: scope_hint: In function ‘pixaDisplayRandomCmap’
leptonica-1.87.0/src/pixafunc2.c:311:5: warning[-Wmaybe-uninitialized]: ‘res’ may be used uninitialized
#  311 |     pixSetResolution(pixd, res, res);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/pixafunc2.c:271:52: note: ‘res’ was declared here
#  271 | l_int32   i, n, same, maxd, index, xb, yb, wb, hb, res;
#      |                                                    ^~~
#  309|       }
#  310|   
#  311|->     pixSetResolution(pixd, res, res);
#  312|       return pixd;
#  313|   }

Error: CPPCHECK_WARNING (CWE-457): [#def1362]
leptonica-1.87.0/src/pixafunc2.c:685: warning[uninitvar]: Uninitialized variable: res
#  683|           }
#  684|       }
#  685|->     pixSetResolution(pixd, res, res);
#  686|   
#  687|       pixaDestroy(&pixa1);

Error: COMPILER_WARNING (CWE-457): [#def1363]
leptonica-1.87.0/src/pixafunc2.c: scope_hint: In function ‘pixaDisplayTiled’
leptonica-1.87.0/src/pixafunc2.c:685:5: warning[-Wmaybe-uninitialized]: ‘res’ may be used uninitialized
#  685 |     pixSetResolution(pixd, res, res);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/pixafunc2.c:623:42: note: ‘res’ was declared here
#  623 | l_int32  wmax, hmax, wd, hd, d, hascmap, res, same;
#      |                                          ^~~
#  683|           }
#  684|       }
#  685|->     pixSetResolution(pixd, res, res);
#  686|   
#  687|       pixaDestroy(&pixa1);

Error: CPPCHECK_WARNING (CWE-457): [#def1364]
leptonica-1.87.0/src/pixafunc2.c:988: warning[uninitvar]: Uninitialized variable: res
#  986|       boxaGetExtent(boxa, &w, &h, NULL);
#  987|       pixd = pixaDisplay(pixa2, w + spacing, h + spacing);
#  988|->     pixSetResolution(pixd, res, res);
#  989|   
#  990|           /* Save the boxa in the text field of the output pix */

Error: COMPILER_WARNING (CWE-457): [#def1365]
leptonica-1.87.0/src/pixafunc2.c: scope_hint: In function ‘pixaDisplayTiledInColumns’
leptonica-1.87.0/src/pixafunc2.c:988:5: warning[-Wmaybe-uninitialized]: ‘res’ may be used uninitialized
#  988 |     pixSetResolution(pixd, res, res);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/pixafunc2.c:918:75: note: ‘res’ was declared here
#  918 | l_int32   i, j, index, n, x, y, nrows, wb, hb, w, h, maxd, maxh, bordval, res;
#      |                                                                           ^~~
#  986|       boxaGetExtent(boxa, &w, &h, NULL);
#  987|       pixd = pixaDisplay(pixa2, w + spacing, h + spacing);
#  988|->     pixSetResolution(pixd, res, res);
#  989|   
#  990|           /* Save the boxa in the text field of the output pix */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1366]
leptonica-1.87.0/src/pixafunc2.c:1099:15: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:1705:1: enter_function: entry to ‘pixaaDisplayTiledAndScaled’
leptonica-1.87.0/src/pixafunc2.c:1717:8: branch_false: following ‘false’ branch (when ‘paa’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:1719:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1721:8: branch_false: following ‘false’ branch (when ‘ncols > 0’)...
leptonica-1.87.0/src/pixafunc2.c:1723:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1726:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:1729:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1730:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixafunc2.c:1731:16: branch_true: ...to here
leptonica-1.87.0/src/pixafunc2.c:1732:15: call_function: calling ‘pixaDisplayTiledAndScaled’ from ‘pixaaDisplayTiledAndScaled’
# 1097|       irow = 0;
# 1098|       for (i = 0; i < n; i++) {
# 1099|->         pix = pixaGetPix(pixan, i, L_CLONE);
# 1100|           ninrow++;
# 1101|           pixGetDimensions(pix, &w, &h, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1367]
leptonica-1.87.0/src/pixafunc2.c:1101:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:1705:1: enter_function: entry to ‘pixaaDisplayTiledAndScaled’
leptonica-1.87.0/src/pixafunc2.c:1717:8: branch_false: following ‘false’ branch (when ‘paa’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:1719:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1721:8: branch_false: following ‘false’ branch (when ‘ncols > 0’)...
leptonica-1.87.0/src/pixafunc2.c:1723:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1726:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:1729:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1730:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixafunc2.c:1731:16: branch_true: ...to here
leptonica-1.87.0/src/pixafunc2.c:1732:15: call_function: calling ‘pixaDisplayTiledAndScaled’ from ‘pixaaDisplayTiledAndScaled’
# 1099|           pix = pixaGetPix(pixan, i, L_CLONE);
# 1100|           ninrow++;
# 1101|->         pixGetDimensions(pix, &w, &h, NULL);
# 1102|           maxht = L_MAX(h, maxht);
# 1103|           if (ninrow == ncols) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1368]
leptonica-1.87.0/src/pixafunc2.c:1108:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:1705:1: enter_function: entry to ‘pixaaDisplayTiledAndScaled’
leptonica-1.87.0/src/pixafunc2.c:1717:8: branch_false: following ‘false’ branch (when ‘paa’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:1719:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1721:8: branch_false: following ‘false’ branch (when ‘ncols > 0’)...
leptonica-1.87.0/src/pixafunc2.c:1723:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1726:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:1729:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1730:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixafunc2.c:1731:16: branch_true: ...to here
leptonica-1.87.0/src/pixafunc2.c:1732:15: call_function: calling ‘pixaDisplayTiledAndScaled’ from ‘pixaaDisplayTiledAndScaled’
# 1106|               irow++;
# 1107|           }
# 1108|->         pixDestroy(&pix);
# 1109|       }
# 1110|       if (ninrow > 0) {   /* last fencepost */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1369]
leptonica-1.87.0/src/pixafunc2.c:1119:12: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:1705:1: enter_function: entry to ‘pixaaDisplayTiledAndScaled’
leptonica-1.87.0/src/pixafunc2.c:1717:8: branch_false: following ‘false’ branch (when ‘paa’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:1719:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1721:8: branch_false: following ‘false’ branch (when ‘ncols > 0’)...
leptonica-1.87.0/src/pixafunc2.c:1723:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1726:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:1729:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1730:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixafunc2.c:1731:16: branch_true: ...to here
leptonica-1.87.0/src/pixafunc2.c:1732:15: call_function: calling ‘pixaDisplayTiledAndScaled’ from ‘pixaaDisplayTiledAndScaled’
# 1117|           hd += rowht[i];
# 1118|   
# 1119|->     pixd = pixCreate(wd, hd, outdepth);
# 1120|       if ((background == 1 && outdepth == 1) ||
# 1121|           (background == 0 && outdepth != 1))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1370]
leptonica-1.87.0/src/pixafunc2.c:1122:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:1705:1: enter_function: entry to ‘pixaaDisplayTiledAndScaled’
leptonica-1.87.0/src/pixafunc2.c:1717:8: branch_false: following ‘false’ branch (when ‘paa’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:1719:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1721:8: branch_false: following ‘false’ branch (when ‘ncols > 0’)...
leptonica-1.87.0/src/pixafunc2.c:1723:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1726:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:1729:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1730:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixafunc2.c:1731:16: branch_true: ...to here
leptonica-1.87.0/src/pixafunc2.c:1732:15: call_function: calling ‘pixaDisplayTiledAndScaled’ from ‘pixaaDisplayTiledAndScaled’
# 1120|       if ((background == 1 && outdepth == 1) ||
# 1121|           (background == 0 && outdepth != 1))
# 1122|->         pixSetAll(pixd);
# 1123|   
# 1124|           /* Now blit images to pixd */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1371]
leptonica-1.87.0/src/pixafunc2.c:1128:15: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:2661:1: enter_function: entry to ‘pixaCompareInPdf’
leptonica-1.87.0/src/pixafunc2.c:2675:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2677:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2677:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2679:8: branch_false: following ‘false’ branch (when ‘tw > 19’)...
leptonica-1.87.0/src/pixafunc2.c:2681:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2681:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2683:8: branch_false: following ‘false’ branch (when ‘fileout’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:2685:10: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2687:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2689:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2694:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2698:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2698:13: call_function: calling ‘pixaConvertToNUpPixa’ from ‘pixaCompareInPdf’
# 1126|       irow = 0;
# 1127|       for (i = 0; i < n; i++) {
# 1128|->         pix = pixaGetPix(pixan, i, L_CLONE);
# 1129|           if (i == 0) {
# 1130|               res = pixGetXRes(pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1372]
leptonica-1.87.0/src/pixafunc2.c:1130:19: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:2661:1: enter_function: entry to ‘pixaCompareInPdf’
leptonica-1.87.0/src/pixafunc2.c:2675:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2677:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2677:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2679:8: branch_false: following ‘false’ branch (when ‘tw > 19’)...
leptonica-1.87.0/src/pixafunc2.c:2681:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2681:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2683:8: branch_false: following ‘false’ branch (when ‘fileout’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:2685:10: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2687:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2689:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2694:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2698:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2698:13: call_function: calling ‘pixaConvertToNUpPixa’ from ‘pixaCompareInPdf’
# 1128|           pix = pixaGetPix(pixan, i, L_CLONE);
# 1129|           if (i == 0) {
# 1130|->             res = pixGetXRes(pix);
# 1131|               pixSetResolution(pixd, res, res);
# 1132|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1373]
leptonica-1.87.0/src/pixafunc2.c:1131:13: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:2661:1: enter_function: entry to ‘pixaCompareInPdf’
leptonica-1.87.0/src/pixafunc2.c:2675:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2677:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2677:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2679:8: branch_false: following ‘false’ branch (when ‘tw > 19’)...
leptonica-1.87.0/src/pixafunc2.c:2681:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2681:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2683:8: branch_false: following ‘false’ branch (when ‘fileout’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:2685:10: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2687:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2689:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2694:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2698:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2698:13: call_function: calling ‘pixaConvertToNUpPixa’ from ‘pixaCompareInPdf’
# 1129|           if (i == 0) {
# 1130|               res = pixGetXRes(pix);
# 1131|->             pixSetResolution(pixd, res, res);
# 1132|           }
# 1133|           pixGetDimensions(pix, &w, &h, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1374]
leptonica-1.87.0/src/pixafunc2.c:1133:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:2661:1: enter_function: entry to ‘pixaCompareInPdf’
leptonica-1.87.0/src/pixafunc2.c:2675:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2677:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2677:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2679:8: branch_false: following ‘false’ branch (when ‘tw > 19’)...
leptonica-1.87.0/src/pixafunc2.c:2681:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2681:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2683:8: branch_false: following ‘false’ branch (when ‘fileout’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:2685:10: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2687:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2689:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2694:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2698:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2698:13: call_function: calling ‘pixaConvertToNUpPixa’ from ‘pixaCompareInPdf’
# 1131|               pixSetResolution(pixd, res, res);
# 1132|           }
# 1133|->         pixGetDimensions(pix, &w, &h, NULL);
# 1134|           if (i && ((i % ncols) == 0)) {  /* start new row */
# 1135|               x = spacing;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1375]
leptonica-1.87.0/src/pixafunc2.c:1139:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:2661:1: enter_function: entry to ‘pixaCompareInPdf’
leptonica-1.87.0/src/pixafunc2.c:2675:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2677:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2677:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2679:8: branch_false: following ‘false’ branch (when ‘tw > 19’)...
leptonica-1.87.0/src/pixafunc2.c:2681:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2681:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2683:8: branch_false: following ‘false’ branch (when ‘fileout’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:2685:10: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2687:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2689:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2694:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2698:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2698:13: call_function: calling ‘pixaConvertToNUpPixa’ from ‘pixaCompareInPdf’
# 1137|               irow++;
# 1138|           }
# 1139|->         pixRasterop(pixd, x, y, w, h, PIX_SRC, pix, 0, 0);
# 1140|           x += tilewidth + spacing;
# 1141|           pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1376]
leptonica-1.87.0/src/pixafunc2.c:1141:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:2661:1: enter_function: entry to ‘pixaCompareInPdf’
leptonica-1.87.0/src/pixafunc2.c:2675:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2677:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2677:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2679:8: branch_false: following ‘false’ branch (when ‘tw > 19’)...
leptonica-1.87.0/src/pixafunc2.c:2681:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2681:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2683:8: branch_false: following ‘false’ branch (when ‘fileout’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:2685:10: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2687:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2689:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2694:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:2698:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:2698:13: call_function: calling ‘pixaConvertToNUpPixa’ from ‘pixaCompareInPdf’
# 1139|           pixRasterop(pixd, x, y, w, h, PIX_SRC, pix, 0, 0);
# 1140|           x += tilewidth + spacing;
# 1141|->         pixDestroy(&pix);
# 1142|       }
# 1143|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1377]
leptonica-1.87.0/src/pixafunc2.c:1144:5: warning[-Wanalyzer-malloc-leak]: leak of ‘rowht’
leptonica-1.87.0/src/pixafunc2.c:1705:1: enter_function: entry to ‘pixaaDisplayTiledAndScaled’
leptonica-1.87.0/src/pixafunc2.c:1717:8: branch_false: following ‘false’ branch (when ‘paa’ is non-NULL)...
leptonica-1.87.0/src/pixafunc2.c:1719:9: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1721:8: branch_false: following ‘false’ branch (when ‘ncols > 0’)...
leptonica-1.87.0/src/pixafunc2.c:1723:8: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1726:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixafunc2.c:1729:13: branch_false: ...to here
leptonica-1.87.0/src/pixafunc2.c:1730:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixafunc2.c:1731:16: branch_true: ...to here
leptonica-1.87.0/src/pixafunc2.c:1732:15: call_function: calling ‘pixaDisplayTiledAndScaled’ from ‘pixaaDisplayTiledAndScaled’
# 1142|       }
# 1143|   
# 1144|->     pixaDestroy(&pixan);
# 1145|       LEPT_FREE(rowht);
# 1146|       return pixd;

Error: CPPCHECK_WARNING (CWE-476): [#def1378]
leptonica-1.87.0/src/pixalloc.c:199: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pms
#  197|       if (minsize % 4 != 0)
#  198|           minsize -= minsize % 4;
#  199|->     pms->minsize = minsize;
#  200|       nlevels = numaGetCount(numalloc);
#  201|       pms->nlevels = nlevels;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1379]
leptonica-1.87.0/src/pixalloc.c:199:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pms’
leptonica-1.87.0/src/pixalloc.c:187:8: branch_false: following ‘false’ branch (when ‘numalloc’ is non-NULL)...
leptonica-1.87.0/src/pixalloc.c:189:5: branch_false: ...to here
leptonica-1.87.0/src/pixalloc.c:193:30: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pixalloc.c:199:5: danger: ‘pms’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  197|       if (minsize % 4 != 0)
#  198|           minsize -= minsize % 4;
#  199|->     pms->minsize = minsize;
#  200|       nlevels = numaGetCount(numalloc);
#  201|       pms->nlevels = nlevels;

Error: CPPCHECK_WARNING (CWE-476): [#def1380]
leptonica-1.87.0/src/pixalloc.c:201: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pms
#  199|       pms->minsize = minsize;
#  200|       nlevels = numaGetCount(numalloc);
#  201|->     pms->nlevels = nlevels;
#  202|   
#  203|       if ((sizes = (size_t *)LEPT_CALLOC(nlevels, sizeof(size_t))) == NULL)

Error: CPPCHECK_WARNING (CWE-476): [#def1381]
leptonica-1.87.0/src/pixalloc.c:205: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pms
#  203|       if ((sizes = (size_t *)LEPT_CALLOC(nlevels, sizeof(size_t))) == NULL)
#  204|           return ERROR_INT("sizes not made", __func__, 1);
#  205|->     pms->sizes = sizes;
#  206|       if (smallest % 4 != 0)
#  207|           smallest += 4 - (smallest % 4);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1382]
leptonica-1.87.0/src/pixalloc.c:409:19: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/pixalloc.c:403:8: branch_false: following ‘false’ branch (when ‘pms’ is non-NULL)...
leptonica-1.87.0/src/pixalloc.c:406:17: branch_false: ...to here
leptonica-1.87.0/src/pixalloc.c:406:17: acquire_memory: allocated here
leptonica-1.87.0/src/pixalloc.c:406:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixalloc.c:408:9: branch_false: ...to here
leptonica-1.87.0/src/pixalloc.c:408:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixalloc.c:409:19: throw: if ‘fopenWriteStream’ throws an exception...
leptonica-1.87.0/src/pixalloc.c:409:19: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  407|           return (void *)ERROR_PTR("data not made", __func__, NULL);
#  408|       if (pms->logfile && nbytes >= pms->smallest) {
#  409|->         if ((fp = fopenWriteStream(pms->logfile, "a")) != NULL) {
#  410|               fprintf(fp, "Alloc %zu bytes at %p\n", nbytes, data);
#  411|               fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1383]
leptonica-1.87.0/src/pixalloc.c:413:13: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/pixalloc.c:403:8: branch_false: following ‘false’ branch (when ‘pms’ is non-NULL)...
leptonica-1.87.0/src/pixalloc.c:406:17: branch_false: ...to here
leptonica-1.87.0/src/pixalloc.c:406:17: acquire_memory: allocated here
leptonica-1.87.0/src/pixalloc.c:406:8: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixalloc.c:408:9: branch_false: ...to here
leptonica-1.87.0/src/pixalloc.c:408:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixalloc.c:409:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixalloc.c:413:13: branch_false: ...to here
leptonica-1.87.0/src/pixalloc.c:413:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixalloc.c:413:13: branch_true: ...to here
leptonica-1.87.0/src/pixalloc.c:413:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/pixalloc.c:413:13: danger: ‘data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  411|               fclose(fp);
#  412|           } else {
#  413|->             L_ERROR("failed to open stream for %s\n", __func__, pms->logfile);
#  414|           }
#  415|       }

Error: CPPCHECK_WARNING (CWE-628): [#def1384]
leptonica-1.87.0/src/pixarith.c:1569: warning[invalidFunctionArg]: Invalid log() argument nr 1. The value is 0 but the valid values are '4.94066e-324:'.
# 1567|       log2 = (l_float32)log((l_float32)2);
# 1568|       for (i = 0; i < 256; i++)
# 1569|->         tab[i] = (l_float32)log((l_float32)i) / log2;
# 1570|   
# 1571|       return tab;

Error: CPPCHECK_WARNING (CWE-476): [#def1385]
leptonica-1.87.0/src/pixcomp.c:218: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  216|           pixc->text = stringNew(text);
#  217|   
#  218|->     pixcompDetermineFormat(comptype, pixc->d, pixc->cmapflag, &format);
#  219|       pixc->comptype = format;
#  220|       ret = pixWriteMem(&data, &size, pix, format);

Error: CPPCHECK_WARNING (CWE-476): [#def1386]
leptonica-1.87.0/src/pixcomp.c:219: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  217|   
#  218|       pixcompDetermineFormat(comptype, pixc->d, pixc->cmapflag, &format);
#  219|->     pixc->comptype = format;
#  220|       ret = pixWriteMem(&data, &size, pix, format);
#  221|       if (ret) {

Error: CPPCHECK_WARNING (CWE-476): [#def1387]
leptonica-1.87.0/src/pixcomp.c:226: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  224|           return NULL;
#  225|       }
#  226|->     pixc->data = data;
#  227|       pixc->size = size;
#  228|   

Error: CPPCHECK_WARNING (CWE-476): [#def1388]
leptonica-1.87.0/src/pixcomp.c:227: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  225|       }
#  226|       pixc->data = data;
#  227|->     pixc->size = size;
#  228|   
#  229|       return pixc;

Error: CPPCHECK_WARNING (CWE-476): [#def1389]
leptonica-1.87.0/src/pixcomp.c:265: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  263|       pixc = (PIXC *)LEPT_CALLOC(1, sizeof(PIXC));
#  264|       d = (spp == 3) ? 32 : bps * spp;
#  265|->     pixc->w = w;
#  266|       pixc->h = h;
#  267|       pixc->d = d;

Error: CPPCHECK_WARNING (CWE-476): [#def1390]
leptonica-1.87.0/src/pixcomp.c:266: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  264|       d = (spp == 3) ? 32 : bps * spp;
#  265|       pixc->w = w;
#  266|->     pixc->h = h;
#  267|       pixc->d = d;
#  268|       pixc->comptype = format;

Error: CPPCHECK_WARNING (CWE-476): [#def1391]
leptonica-1.87.0/src/pixcomp.c:267: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  265|       pixc->w = w;
#  266|       pixc->h = h;
#  267|->     pixc->d = d;
#  268|       pixc->comptype = format;
#  269|       pixc->cmapflag = iscmap;

Error: CPPCHECK_WARNING (CWE-476): [#def1392]
leptonica-1.87.0/src/pixcomp.c:268: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  266|       pixc->h = h;
#  267|       pixc->d = d;
#  268|->     pixc->comptype = format;
#  269|       pixc->cmapflag = iscmap;
#  270|       if (copyflag == L_INSERT)

Error: CPPCHECK_WARNING (CWE-476): [#def1393]
leptonica-1.87.0/src/pixcomp.c:269: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  267|       pixc->d = d;
#  268|       pixc->comptype = format;
#  269|->     pixc->cmapflag = iscmap;
#  270|       if (copyflag == L_INSERT)
#  271|           pixc->data = data;

Error: CPPCHECK_WARNING (CWE-476): [#def1394]
leptonica-1.87.0/src/pixcomp.c:271: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  269|       pixc->cmapflag = iscmap;
#  270|       if (copyflag == L_INSERT)
#  271|->         pixc->data = data;
#  272|       else
#  273|           pixc->data = l_binaryCopy(data, size);

Error: CPPCHECK_WARNING (CWE-476): [#def1395]
leptonica-1.87.0/src/pixcomp.c:273: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  271|           pixc->data = data;
#  272|       else
#  273|->         pixc->data = l_binaryCopy(data, size);
#  274|       pixc->size = size;
#  275|       return pixc;

Error: CPPCHECK_WARNING (CWE-476): [#def1396]
leptonica-1.87.0/src/pixcomp.c:274: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
#  272|       else
#  273|           pixc->data = l_binaryCopy(data, size);
#  274|->     pixc->size = size;
#  275|       return pixc;
#  276|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1397]
leptonica-1.87.0/src/pixcomp.c:361:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:32: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1706:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1706:13: call_function: calling ‘pixacompDestroy’ from ‘pixacompReadStream’
#  359|   
#  360|       if (!ppixc) {
#  361|->         L_WARNING("ptr address is null!\n", __func__);
#  362|           return;
#  363|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1398]
leptonica-1.87.0/src/pixcomp.c:401: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixcd
#  399|   
#  400|       pixcd = (PIXC *)LEPT_CALLOC(1, sizeof(PIXC));
#  401|->     pixcd->w = pixcs->w;
#  402|       pixcd->h = pixcs->h;
#  403|       pixcd->d = pixcs->d;

Error: CPPCHECK_WARNING (CWE-476): [#def1399]
leptonica-1.87.0/src/pixcomp.c:402: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixcd
#  400|       pixcd = (PIXC *)LEPT_CALLOC(1, sizeof(PIXC));
#  401|       pixcd->w = pixcs->w;
#  402|->     pixcd->h = pixcs->h;
#  403|       pixcd->d = pixcs->d;
#  404|       pixcd->xres = pixcs->xres;

Error: CPPCHECK_WARNING (CWE-476): [#def1400]
leptonica-1.87.0/src/pixcomp.c:403: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixcd
#  401|       pixcd->w = pixcs->w;
#  402|       pixcd->h = pixcs->h;
#  403|->     pixcd->d = pixcs->d;
#  404|       pixcd->xres = pixcs->xres;
#  405|       pixcd->yres = pixcs->yres;

Error: CPPCHECK_WARNING (CWE-476): [#def1401]
leptonica-1.87.0/src/pixcomp.c:404: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixcd
#  402|       pixcd->h = pixcs->h;
#  403|       pixcd->d = pixcs->d;
#  404|->     pixcd->xres = pixcs->xres;
#  405|       pixcd->yres = pixcs->yres;
#  406|       pixcd->comptype = pixcs->comptype;

Error: CPPCHECK_WARNING (CWE-476): [#def1402]
leptonica-1.87.0/src/pixcomp.c:405: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixcd
#  403|       pixcd->d = pixcs->d;
#  404|       pixcd->xres = pixcs->xres;
#  405|->     pixcd->yres = pixcs->yres;
#  406|       pixcd->comptype = pixcs->comptype;
#  407|       if (pixcs->text != NULL)

Error: CPPCHECK_WARNING (CWE-476): [#def1403]
leptonica-1.87.0/src/pixcomp.c:406: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixcd
#  404|       pixcd->xres = pixcs->xres;
#  405|       pixcd->yres = pixcs->yres;
#  406|->     pixcd->comptype = pixcs->comptype;
#  407|       if (pixcs->text != NULL)
#  408|           pixcd->text = stringNew(pixcs->text);

Error: CPPCHECK_WARNING (CWE-476): [#def1404]
leptonica-1.87.0/src/pixcomp.c:409: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixcd
#  407|       if (pixcs->text != NULL)
#  408|           pixcd->text = stringNew(pixcs->text);
#  409|->     pixcd->cmapflag = pixcs->cmapflag;
#  410|   
#  411|           /* Copy image data */

Error: CPPCHECK_WARNING (CWE-476): [#def1405]
leptonica-1.87.0/src/pixcomp.c:418: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixcd
#  416|       }
#  417|       memcpy(datad, datas, size);
#  418|->     pixcd->data = datad;
#  419|       pixcd->size = size;
#  420|       return pixcd;

Error: CPPCHECK_WARNING (CWE-476): [#def1406]
leptonica-1.87.0/src/pixcomp.c:419: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixcd
#  417|       memcpy(datad, datas, size);
#  418|       pixcd->data = datad;
#  419|->     pixcd->size = size;
#  420|       return pixcd;
#  421|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1407]
leptonica-1.87.0/src/pixcomp.c:600: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixac
#  598|   
#  599|       pixac = (PIXAC *)LEPT_CALLOC(1, sizeof(PIXAC));
#  600|->     pixac->n = 0;
#  601|       pixac->nalloc = n;
#  602|       pixac->offset = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1408]
leptonica-1.87.0/src/pixcomp.c:600:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixac’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
#  598|   
#  599|       pixac = (PIXAC *)LEPT_CALLOC(1, sizeof(PIXAC));
#  600|->     pixac->n = 0;
#  601|       pixac->nalloc = n;
#  602|       pixac->offset = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def1409]
leptonica-1.87.0/src/pixcomp.c:601: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixac
#  599|       pixac = (PIXAC *)LEPT_CALLOC(1, sizeof(PIXAC));
#  600|       pixac->n = 0;
#  601|->     pixac->nalloc = n;
#  602|       pixac->offset = 0;
#  603|       if ((pixac->pixc = (PIXC **)LEPT_CALLOC(n, sizeof(PIXC *))) == NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def1410]
leptonica-1.87.0/src/pixcomp.c:602: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixac
#  600|       pixac->n = 0;
#  601|       pixac->nalloc = n;
#  602|->     pixac->offset = 0;
#  603|       if ((pixac->pixc = (PIXC **)LEPT_CALLOC(n, sizeof(PIXC *))) == NULL) {
#  604|           pixacompDestroy(&pixac);

Error: CPPCHECK_WARNING (CWE-476): [#def1411]
leptonica-1.87.0/src/pixcomp.c:603: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixac
#  601|       pixac->nalloc = n;
#  602|       pixac->offset = 0;
#  603|->     if ((pixac->pixc = (PIXC **)LEPT_CALLOC(n, sizeof(PIXC *))) == NULL) {
#  604|           pixacompDestroy(&pixac);
#  605|           return (PIXAC *)ERROR_PTR("pixc ptrs not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def1412]
leptonica-1.87.0/src/pixcomp.c:607: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixac
#  605|           return (PIXAC *)ERROR_PTR("pixc ptrs not made", __func__, NULL);
#  606|       }
#  607|->     if ((pixac->boxa = boxaCreate(n)) == NULL) {
#  608|           pixacompDestroy(&pixac);
#  609|           return (PIXAC *)ERROR_PTR("boxa not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1413]
leptonica-1.87.0/src/pixcomp.c:607:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
#  605|           return (PIXAC *)ERROR_PTR("pixc ptrs not made", __func__, NULL);
#  606|       }
#  607|->     if ((pixac->boxa = boxaCreate(n)) == NULL) {
#  608|           pixacompDestroy(&pixac);
#  609|           return (PIXAC *)ERROR_PTR("boxa not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1414]
leptonica-1.87.0/src/pixcomp.c:607:24: warning[-Wanalyzer-malloc-leak]: leak of ‘pixac’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
#  605|           return (PIXAC *)ERROR_PTR("pixc ptrs not made", __func__, NULL);
#  606|       }
#  607|->     if ((pixac->boxa = boxaCreate(n)) == NULL) {
#  608|           pixacompDestroy(&pixac);
#  609|           return (PIXAC *)ERROR_PTR("boxa not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1415]
leptonica-1.87.0/src/pixcomp.c:867:5: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:32: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1706:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1706:13: call_function: calling ‘pixacompDestroy’ from ‘pixacompReadStream’
#  865|           pixcompDestroy(&pixac->pixc[i]);
#  866|       LEPT_FREE(pixac->pixc);
#  867|->     boxaDestroy(&pixac->boxa);
#  868|       LEPT_FREE(pixac);
#  869|       *ppixac = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1416]
leptonica-1.87.0/src/pixcomp.c:867:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pixac’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
#  865|           pixcompDestroy(&pixac->pixc[i]);
#  866|       LEPT_FREE(pixac->pixc);
#  867|->     boxaDestroy(&pixac->boxa);
#  868|       LEPT_FREE(pixac);
#  869|       *ppixac = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1417]
leptonica-1.87.0/src/pixcomp.c:941:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:32: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  939|   
#  940|       if (!pixac)
#  941|->         return ERROR_INT("pixac not defined", __func__, 1);
#  942|       if (!pixc)
#  943|           return ERROR_INT("pixc not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1418]
leptonica-1.87.0/src/pixcomp.c:941:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixc’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1711:24: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  939|   
#  940|       if (!pixac)
#  941|->         return ERROR_INT("pixac not defined", __func__, 1);
#  942|       if (!pixc)
#  943|           return ERROR_INT("pixc not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1419]
leptonica-1.87.0/src/pixcomp.c:950:20: warning[-Wanalyzer-malloc-leak]: leak of ‘pixc’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1711:24: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  948|       if (n >= pixac->nalloc) {
#  949|           if (pixacompExtendArray(pixac))
#  950|->             return ERROR_INT("extension failed", __func__, 1);
#  951|       }
#  952|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1420]
leptonica-1.87.0/src/pixcomp.c:986:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:32: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  984|           return ERROR_INT("pixac not defined", __func__, 1);
#  985|       if (pixac->nalloc > (l_int32)MaxPtrArraySize)  /* belt & suspenders */
#  986|->         return ERROR_INT("pixac has too many ptrs", __func__, 1);
#  987|       oldsize = pixac->nalloc * sizeof(PIXC *);
#  988|       newsize = 2 * oldsize;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1421]
leptonica-1.87.0/src/pixcomp.c:986:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixc’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1711:24: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  984|           return ERROR_INT("pixac not defined", __func__, 1);
#  985|       if (pixac->nalloc > (l_int32)MaxPtrArraySize)  /* belt & suspenders */
#  986|->         return ERROR_INT("pixac has too many ptrs", __func__, 1);
#  987|       oldsize = pixac->nalloc * sizeof(PIXC *);
#  988|       newsize = 2 * oldsize;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1422]
leptonica-1.87.0/src/pixcomp.c:990:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:32: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  988|       newsize = 2 * oldsize;
#  989|       if (newsize > 8 * MaxPtrArraySize)  /* ptrs for 1M pixcomp */
#  990|->         return ERROR_INT("newsize > 8 MB; too large", __func__, 1);
#  991|   
#  992|       if ((pixac->pixc = (PIXC **)reallocNew((void **)&pixac->pixc,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1423]
leptonica-1.87.0/src/pixcomp.c:990:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixc’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1711:24: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  988|       newsize = 2 * oldsize;
#  989|       if (newsize > 8 * MaxPtrArraySize)  /* ptrs for 1M pixcomp */
#  990|->         return ERROR_INT("newsize > 8 MB; too large", __func__, 1);
#  991|   
#  992|       if ((pixac->pixc = (PIXC **)reallocNew((void **)&pixac->pixc,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1424]
leptonica-1.87.0/src/pixcomp.c:992:33: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:32: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  990|           return ERROR_INT("newsize > 8 MB; too large", __func__, 1);
#  991|   
#  992|->     if ((pixac->pixc = (PIXC **)reallocNew((void **)&pixac->pixc,
#  993|                                              oldsize, newsize)) == NULL)
#  994|           return ERROR_INT("new ptr array not returned", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1425]
leptonica-1.87.0/src/pixcomp.c:992:33: warning[-Wanalyzer-malloc-leak]: leak of ‘pixc’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1711:24: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  990|           return ERROR_INT("newsize > 8 MB; too large", __func__, 1);
#  991|   
#  992|->     if ((pixac->pixc = (PIXC **)reallocNew((void **)&pixac->pixc,
#  993|                                              oldsize, newsize)) == NULL)
#  994|           return ERROR_INT("new ptr array not returned", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1426]
leptonica-1.87.0/src/pixcomp.c:994:16: warning[-Wanalyzer-malloc-leak]: leak of ‘pixc’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1711:24: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  992|       if ((pixac->pixc = (PIXC **)reallocNew((void **)&pixac->pixc,
#  993|                                              oldsize, newsize)) == NULL)
#  994|->         return ERROR_INT("new ptr array not returned", __func__, 1);
#  995|       pixac->nalloc *= 2;
#  996|       boxaExtendArray(pixac->boxa);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1427]
leptonica-1.87.0/src/pixcomp.c:996:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pixc’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1711:24: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1721:9: call_function: calling ‘pixacompAddPixcomp’ from ‘pixacompReadStream’
#  994|           return ERROR_INT("new ptr array not returned", __func__, 1);
#  995|       pixac->nalloc *= 2;
#  996|->     boxaExtendArray(pixac->boxa);
#  997|       return 0;
#  998|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1428]
leptonica-1.87.0/src/pixcomp.c:1710:9: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:32: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1710:9: throw: if ‘fgetc’ throws an exception...
leptonica-1.87.0/src/pixcomp.c:1710:9: danger: ‘data’ leaks here; was allocated at [(53)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/52)
# 1708|               return (PIXAC *)ERROR_PTR("error reading data", __func__, NULL);
# 1709|           }
# 1710|->         fgetc(fp);  /* swallow the ending nl */
# 1711|           pixc = (PIXC *)LEPT_CALLOC(1, sizeof(PIXC));
# 1712|           pixc->w = w;

Error: CPPCHECK_WARNING (CWE-476): [#def1429]
leptonica-1.87.0/src/pixcomp.c:1712: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
# 1710|           fgetc(fp);  /* swallow the ending nl */
# 1711|           pixc = (PIXC *)LEPT_CALLOC(1, sizeof(PIXC));
# 1712|->         pixc->w = w;
# 1713|           pixc->h = h;
# 1714|           pixc->d = d;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1430]
leptonica-1.87.0/src/pixcomp.c:1712:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixc’
leptonica-1.87.0/src/pixcomp.c:1633:1: enter_function: entry to ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1647:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1649:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1649:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1651:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1651:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1653:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1653:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1655:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1657:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1659:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1661:18: call_function: calling ‘pixacompCreate’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1661:18: return_function: returning to ‘pixacompReadStream’ from ‘pixacompCreate’
leptonica-1.87.0/src/pixcomp.c:1661:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1663:17: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1663:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1667:23: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1669:5: call_function: calling ‘pixacompSetOffset’ from ‘pixacompReadStream’
leptonica-1.87.0/src/pixcomp.c:1669:5: return_function: returning to ‘pixacompReadStream’ from ‘pixacompSetOffset’
leptonica-1.87.0/src/pixcomp.c:1671:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixcomp.c:1672:13: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1672:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1677:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1677:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1682:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1682:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1693:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1693:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1697:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1697:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1701:32: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1701:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1705:13: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1705:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixcomp.c:1710:9: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1711:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pixcomp.c:1712:9: danger: ‘pixc’ could be NULL: unchecked value from [(57)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/56)
# 1710|           fgetc(fp);  /* swallow the ending nl */
# 1711|           pixc = (PIXC *)LEPT_CALLOC(1, sizeof(PIXC));
# 1712|->         pixc->w = w;
# 1713|           pixc->h = h;
# 1714|           pixc->d = d;

Error: CPPCHECK_WARNING (CWE-476): [#def1431]
leptonica-1.87.0/src/pixcomp.c:1713: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
# 1711|           pixc = (PIXC *)LEPT_CALLOC(1, sizeof(PIXC));
# 1712|           pixc->w = w;
# 1713|->         pixc->h = h;
# 1714|           pixc->d = d;
# 1715|           pixc->xres = xres;

Error: CPPCHECK_WARNING (CWE-476): [#def1432]
leptonica-1.87.0/src/pixcomp.c:1714: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
# 1712|           pixc->w = w;
# 1713|           pixc->h = h;
# 1714|->         pixc->d = d;
# 1715|           pixc->xres = xres;
# 1716|           pixc->yres = yres;

Error: CPPCHECK_WARNING (CWE-476): [#def1433]
leptonica-1.87.0/src/pixcomp.c:1715: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
# 1713|           pixc->h = h;
# 1714|           pixc->d = d;
# 1715|->         pixc->xres = xres;
# 1716|           pixc->yres = yres;
# 1717|           pixc->comptype = comptype;

Error: CPPCHECK_WARNING (CWE-476): [#def1434]
leptonica-1.87.0/src/pixcomp.c:1716: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
# 1714|           pixc->d = d;
# 1715|           pixc->xres = xres;
# 1716|->         pixc->yres = yres;
# 1717|           pixc->comptype = comptype;
# 1718|           pixc->cmapflag = cmapflag;

Error: CPPCHECK_WARNING (CWE-476): [#def1435]
leptonica-1.87.0/src/pixcomp.c:1717: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
# 1715|           pixc->xres = xres;
# 1716|           pixc->yres = yres;
# 1717|->         pixc->comptype = comptype;
# 1718|           pixc->cmapflag = cmapflag;
# 1719|           pixc->data = data;

Error: CPPCHECK_WARNING (CWE-476): [#def1436]
leptonica-1.87.0/src/pixcomp.c:1718: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
# 1716|           pixc->yres = yres;
# 1717|           pixc->comptype = comptype;
# 1718|->         pixc->cmapflag = cmapflag;
# 1719|           pixc->data = data;
# 1720|           pixc->size = size;

Error: CPPCHECK_WARNING (CWE-476): [#def1437]
leptonica-1.87.0/src/pixcomp.c:1719: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
# 1717|           pixc->comptype = comptype;
# 1718|           pixc->cmapflag = cmapflag;
# 1719|->         pixc->data = data;
# 1720|           pixc->size = size;
# 1721|           pixacompAddPixcomp(pixac, pixc, L_INSERT);

Error: CPPCHECK_WARNING (CWE-476): [#def1438]
leptonica-1.87.0/src/pixcomp.c:1720: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixc
# 1718|           pixc->cmapflag = cmapflag;
# 1719|           pixc->data = data;
# 1720|->         pixc->size = size;
# 1721|           pixacompAddPixcomp(pixac, pixc, L_INSERT);
# 1722|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1439]
leptonica-1.87.0/src/pixcomp.c:1818:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pixcomp.c:1849:1: enter_function: entry to ‘pixacompWriteMem’
leptonica-1.87.0/src/pixcomp.c:1857:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1857:16: branch_true: ...to here
leptonica-1.87.0/src/pixcomp.c:1858:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1860:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1860:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1862:8: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1862:8: branch_false: following ‘false’ branch (when ‘pixac’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1866:15: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1866:15: acquire_memory: allocated here
leptonica-1.87.0/src/pixcomp.c:1866:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pixcomp.c:1868:11: branch_false: ...to here
leptonica-1.87.0/src/pixcomp.c:1868:11: call_function: calling ‘pixacompWriteStream’ from ‘pixacompWriteMem’
# 1816|       fprintf(fp, "Number of pixcomp = %d\n", n);
# 1817|       fprintf(fp, "Offset of index into array = %d", pixac->offset);
# 1818|->     boxaWriteStream(fp, pixac->boxa);
# 1819|       for (i = 0; i < n; i++) {
# 1820|           if ((pixc = pixacompGetPixcomp(pixac, pixac->offset + i, L_NOCOPY))

Error: CPPCHECK_WARNING (CWE-476): [#def1440]
leptonica-1.87.0/src/pixconv.c:408: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: graymap
#  406|           graymap = (l_uint32 *)LEPT_CALLOC(nalloc, sizeof(l_uint32));
#  407|           for (i = 0; i < ncolors; i++) {
#  408|->             graymap[i] = (l_uint32)(L_RED_WEIGHT * rmap[i] +
#  409|                                       L_GREEN_WEIGHT * gmap[i] +
#  410|                                       L_BLUE_WEIGHT * bmap[i] + 0.5);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1441]
leptonica-1.87.0/src/pixconv.c:408:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘graymap’
leptonica-1.87.0/src/pixconv.c:3970:1: enter_function: entry to ‘pixConvertGrayToSubpixelRGB’
leptonica-1.87.0/src/pixconv.c:3984:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixconv.c:3986:8: branch_false: ...to here
leptonica-1.87.0/src/pixconv.c:3986:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixconv.c:3988:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixconv.c:3993:9: branch_false: ...to here
leptonica-1.87.0/src/pixconv.c:3995:12: call_function: calling ‘pixRemoveColormap’ from ‘pixConvertGrayToSubpixelRGB’
#  406|           graymap = (l_uint32 *)LEPT_CALLOC(nalloc, sizeof(l_uint32));
#  407|           for (i = 0; i < ncolors; i++) {
#  408|->             graymap[i] = (l_uint32)(L_RED_WEIGHT * rmap[i] +
#  409|                                       L_GREEN_WEIGHT * gmap[i] +
#  410|                                       L_BLUE_WEIGHT * bmap[i] + 0.5);

Error: CPPCHECK_WARNING (CWE-682): [#def1442]
leptonica-1.87.0/src/pixconv.c:566: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  564|           for (i = 0; i < ncolors; i++) {
#  565|               if (type == REMOVE_CMAP_TO_FULL_COLOR)
#  566|->                 composeRGBPixel(rmap[i], gmap[i], bmap[i], lut + i);
#  567|               else  /* full color plus alpha */
#  568|                   composeRGBAPixel(rmap[i], gmap[i], bmap[i], amap[i], lut + i);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1443]
leptonica-1.87.0/src/pixconv.c:566:17: warning[-Wanalyzer-malloc-leak]: leak of ‘lut’
leptonica-1.87.0/src/pixconv.c:3248:1: enter_function: entry to ‘pixConvertTo32’
leptonica-1.87.0/src/pixconv.c:3270:16: call_function: calling ‘pixConvert8To32’ from ‘pixConvertTo32’
#  564|           for (i = 0; i < ncolors; i++) {
#  565|               if (type == REMOVE_CMAP_TO_FULL_COLOR)
#  566|->                 composeRGBPixel(rmap[i], gmap[i], bmap[i], lut + i);
#  567|               else  /* full color plus alpha */
#  568|                   composeRGBAPixel(rmap[i], gmap[i], bmap[i], amap[i], lut + i);

Error: CPPCHECK_WARNING (CWE-682): [#def1444]
leptonica-1.87.0/src/pixconv.c:568: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  566|                   composeRGBPixel(rmap[i], gmap[i], bmap[i], lut + i);
#  567|               else  /* full color plus alpha */
#  568|->                 composeRGBAPixel(rmap[i], gmap[i], bmap[i], amap[i], lut + i);
#  569|           }
#  570|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1445]
leptonica-1.87.0/src/pixconv.c:584:21: warning[-Wanalyzer-malloc-leak]: leak of ‘lut’
leptonica-1.87.0/src/pixconv.c:3248:1: enter_function: entry to ‘pixConvertTo32’
leptonica-1.87.0/src/pixconv.c:3270:16: call_function: calling ‘pixConvert8To32’ from ‘pixConvertTo32’
#  582|                       sval = GET_DATA_BIT(lines, j);
#  583|                   if (sval >= ncolors)
#  584|->                     L_WARNING("pixel value out of bounds\n", __func__);
#  585|                   else
#  586|                       lined[j] = lut[sval];

Error: CPPCHECK_WARNING (CWE-476): [#def1446]
leptonica-1.87.0/src/pixconv.c:682: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: inta
#  680|           for (j = 0; j < w; j++) {
#  681|               val = GET_DATA_BYTE(line1, j);
#  682|->             inta[val] = 1;
#  683|           }
#  684|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1447]
leptonica-1.87.0/src/pixconv.c:688: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: inta
#  686|       revmap = (l_int32 *)LEPT_CALLOC(256, sizeof(l_int32));
#  687|       for (i = 0, index = 0; i < 256; i++) {
#  688|->         if (inta[i]) {
#  689|               pixcmapAddColor(cmap, i, i, i);
#  690|               revmap[i] = index++;

Error: CPPCHECK_WARNING (CWE-476): [#def1448]
leptonica-1.87.0/src/pixconv.c:706: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: revmap
#  704|           for (j = 0; j < w; j++) {
#  705|               val = GET_DATA_BYTE(line1, j);
#  706|->             SET_DATA_BYTE(lined, j, revmap[val]);
#  707|           }
#  708|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1449]
leptonica-1.87.0/src/pixconv.c:1061: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: invmax
# 1059|       ratio = (l_float32 *)LEPT_CALLOC(256, sizeof(l_float32));
# 1060|       for (i = 1; i < 256; i++) {  /* i == 0  --> delta = sval = newval = 0 */
# 1061|->         invmax[i] = 1.0f / (l_float32)i;
# 1062|           ratio[i] = (l_float32)i / (l_float32)refval;
# 1063|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1450]
leptonica-1.87.0/src/pixconv.c:1062: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ratio
# 1060|       for (i = 1; i < 256; i++) {  /* i == 0  --> delta = sval = newval = 0 */
# 1061|           invmax[i] = 1.0f / (l_float32)i;
# 1062|->         ratio[i] = (l_float32)i / (l_float32)refval;
# 1063|       }
# 1064|       for (i = 0; i < h; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def1451]
leptonica-1.87.0/src/pixconv.c:1079: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ratio
# 1077|                   sval = (l_int32)(255. * (l_float32)delta * invmax[max] + 0.5);
# 1078|   
# 1079|->             fullsat = L_MIN(255, 255 * ratio[max]);
# 1080|               newval = (sval * fullsat + (255 - sval) * max) / 255;
# 1081|               SET_DATA_BYTE(lined, j, newval);

Error: CPPCHECK_WARNING (CWE-476): [#def1452]
leptonica-1.87.0/src/pixconv.c:1969: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 1967|       val[1] = val1;
# 1968|       for (index = 0; index < 4; index++) {
# 1969|->         tab[index] = (val[(index >> 1) & 1] << 16) | val[index & 1];
# 1970|       }
# 1971|   

Error: CPPCHECK_WARNING (CWE-476): [#def1453]
leptonica-1.87.0/src/pixconv.c:1982: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 1980|           for (j = 0; j < ndibits; j++) {
# 1981|               dibit = GET_DATA_DIBIT(lines, j);
# 1982|->             lined[j] = tab[dibit];
# 1983|           }
# 1984|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1454]
leptonica-1.87.0/src/pixconv.c:2144: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2142|       val[1] = val1;
# 2143|       for (index = 0; index < 256; index++) {
# 2144|->         tab[index] = (val[(index >> 7) & 1] << 14) |
# 2145|                        (val[(index >> 6) & 1] << 12) |
# 2146|                        (val[(index >> 5) & 1] << 10) |

Error: CPPCHECK_WARNING (CWE-476): [#def1455]
leptonica-1.87.0/src/pixconv.c:2163: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2161|           for (j = 0; j < nbytes; j++) {
# 2162|               byteval = GET_DATA_BYTE(lines, j);
# 2163|->             SET_DATA_TWO_BYTES(lined, j, tab[byteval]);
# 2164|           }
# 2165|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1456]
leptonica-1.87.0/src/pixconv.c:2261: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2259|       val[1] = val1;
# 2260|       for (index = 0; index < 256; index++) {
# 2261|->         tab[index] = (val[(index >> 7) & 1] << 28) |
# 2262|                        (val[(index >> 6) & 1] << 24) |
# 2263|                        (val[(index >> 5) & 1] << 20) |

Error: CPPCHECK_WARNING (CWE-476): [#def1457]
leptonica-1.87.0/src/pixconv.c:2280: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2278|           for (j = 0; j < nbytes; j++) {
# 2279|               byteval = GET_DATA_BYTE(lines, j);
# 2280|->             lined[j] = tab[byteval];
# 2281|           }
# 2282|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1458]
leptonica-1.87.0/src/pixconv.c:2379: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2377|       val[1] = val1;
# 2378|       for (index = 0; index < 16; index++) {
# 2379|->         tab[index] = ((l_uint32)val[(index >> 3) & 1] << 24) |
# 2380|                        (val[(index >> 2) & 1] << 16) |
# 2381|                        (val[(index >> 1) & 1] << 8) | val[index & 1];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1459]
leptonica-1.87.0/src/pixconv.c:2379:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/pixconv.c:3057:1: enter_function: entry to ‘pixConvertTo8’
leptonica-1.87.0/src/pixconv.c:3067:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixconv.c:3070:8: branch_false: ...to here
leptonica-1.87.0/src/pixconv.c:3070:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixconv.c:3071:12: branch_true: ...to here
leptonica-1.87.0/src/pixconv.c:3071:12: branch_false: following ‘false’ branch (when ‘cmapflag == 0’)...
leptonica-1.87.0/src/pixconv.c:3074:20: branch_false: ...to here
leptonica-1.87.0/src/pixconv.c:3074:20: call_function: calling ‘pixConvert1To8’ from ‘pixConvertTo8’
# 2377|       val[1] = val1;
# 2378|       for (index = 0; index < 16; index++) {
# 2379|->         tab[index] = ((l_uint32)val[(index >> 3) & 1] << 24) |
# 2380|                        (val[(index >> 2) & 1] << 16) |
# 2381|                        (val[(index >> 1) & 1] << 8) | val[index & 1];

Error: CPPCHECK_WARNING (CWE-476): [#def1460]
leptonica-1.87.0/src/pixconv.c:2394: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2392|           for (j = 0; j < nqbits; j++) {
# 2393|               qbit = GET_DATA_QBIT(lines, j);
# 2394|->             lined[j] = tab[qbit];
# 2395|           }
# 2396|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1461]
leptonica-1.87.0/src/pixconv.c:2499: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2497|       val[3] = val3;
# 2498|       for (index = 0; index < 256; index++) {
# 2499|->         tab[index] = (val[(index >> 6) & 3] << 24) |
# 2500|                        (val[(index >> 4) & 3] << 16) |
# 2501|                        (val[(index >> 2) & 3] << 8) | val[index & 3];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1462]
leptonica-1.87.0/src/pixconv.c:2499:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/pixconv.c:3057:1: enter_function: entry to ‘pixConvertTo8’
leptonica-1.87.0/src/pixconv.c:3070:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixconv.c:3070:8: branch_false: ...to here
leptonica-1.87.0/src/pixconv.c:3076:16: call_function: calling ‘pixConvert2To8’ from ‘pixConvertTo8’
# 2497|       val[3] = val3;
# 2498|       for (index = 0; index < 256; index++) {
# 2499|->         tab[index] = (val[(index >> 6) & 3] << 24) |
# 2500|                        (val[(index >> 4) & 3] << 16) |
# 2501|                        (val[(index >> 2) & 3] << 8) | val[index & 3];

Error: CPPCHECK_WARNING (CWE-476): [#def1463]
leptonica-1.87.0/src/pixconv.c:2510: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2508|           for (j = 0; j < nbytes; j++) {
# 2509|               byte = GET_DATA_BYTE(lines, j);
# 2510|->             lined[j] = tab[byte];
# 2511|           }
# 2512|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1464]
leptonica-1.87.0/src/pixconv.c:3362: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 3360|       tab = (l_uint32 *)LEPT_CALLOC(256, sizeof(l_uint32));
# 3361|       for (i = 0; i < 256; i++)
# 3362|->       tab[i] = ((l_uint32)i << 24) | (i << 16) | (i << 8);
# 3363|   
# 3364|           /* Replicate 1 --> 4 bytes (alpha byte not set) */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1465]
leptonica-1.87.0/src/pixconv.c:3362:7: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/pixconv.c:3248:1: enter_function: entry to ‘pixConvertTo32’
leptonica-1.87.0/src/pixconv.c:3270:16: call_function: calling ‘pixConvert8To32’ from ‘pixConvertTo32’
# 3360|       tab = (l_uint32 *)LEPT_CALLOC(256, sizeof(l_uint32));
# 3361|       for (i = 0; i < 256; i++)
# 3362|->       tab[i] = ((l_uint32)i << 24) | (i << 16) | (i << 8);
# 3363|   
# 3364|           /* Replicate 1 --> 4 bytes (alpha byte not set) */

Error: CPPCHECK_WARNING (CWE-476): [#def1466]
leptonica-1.87.0/src/pixconv.c:3370: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 3368|           for (j = 0; j < w; j++) {
# 3369|               val = GET_DATA_BYTE(lines, j);
# 3370|->             lined[j] = tab[val];
# 3371|           }
# 3372|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1467]
leptonica-1.87.0/src/pixlabel.c:528: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: *pneigh
#  526|           *pneigh = (l_int32 *)LEPT_CALLOC(index, sizeof(l_int32));
#  527|           for (i = 0; i < index; i++)
#  528|->             (*pneigh)[i] = neigh[i];
#  529|       }
#  530|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1468]
leptonica-1.87.0/src/pixlabel.c:528:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*pneigh’
leptonica-1.87.0/src/pixlabel.c:493:8: branch_true: following ‘true’ branch (when ‘pnvals’ is non-NULL)...
leptonica-1.87.0/src/pixlabel.c:493:17: branch_true: ...to here
leptonica-1.87.0/src/pixlabel.c:494:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixlabel.c:496:8: branch_false: ...to here
leptonica-1.87.0/src/pixlabel.c:496:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixlabel.c:500:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixlabel.c:504:12: branch_false: ...to here
leptonica-1.87.0/src/pixlabel.c:520:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pixlabel.c:521:19: branch_true: ...to here
leptonica-1.87.0/src/pixlabel.c:525:8: branch_true: following ‘true’ branch (when ‘index != 0’)...
leptonica-1.87.0/src/pixlabel.c:526:30: branch_true: ...to here
leptonica-1.87.0/src/pixlabel.c:526:30: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pixlabel.c:527:21: branch_true: following ‘true’ branch (when ‘i < index’)...
leptonica-1.87.0/src/pixlabel.c:528:22: branch_true: ...to here
leptonica-1.87.0/src/pixlabel.c:528:13: danger: ‘calloc((long unsigned int)index, 4) + (long unsigned int)i * 4’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  526|           *pneigh = (l_int32 *)LEPT_CALLOC(index, sizeof(l_int32));
#  527|           for (i = 0; i < index; i++)
#  528|->             (*pneigh)[i] = neigh[i];
#  529|       }
#  530|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1469]
leptonica-1.87.0/src/pixlabel.c:528:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘neigh’
leptonica-1.87.0/src/pixlabel.c:348:1: enter_function: entry to ‘pixConnCompIncrAdd’
leptonica-1.87.0/src/pixlabel.c:360:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixlabel.c:362:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/pixlabel.c:364:8: branch_false: ...to here
leptonica-1.87.0/src/pixlabel.c:364:8: branch_false: following ‘false’ branch (when ‘pncc’ is non-NULL)...
leptonica-1.87.0/src/pixlabel.c:366:5: branch_false: ...to here
leptonica-1.87.0/src/pixlabel.c:367:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixlabel.c:369:5: branch_false: ...to here
leptonica-1.87.0/src/pixlabel.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixlabel.c:372:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixlabel.c:376:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixlabel.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/pixlabel.c:384:5: call_function: calling ‘pixGetSortedNeighborValues’ from ‘pixConnCompIncrAdd’
#  526|           *pneigh = (l_int32 *)LEPT_CALLOC(index, sizeof(l_int32));
#  527|           for (i = 0; i < index; i++)
#  528|->             (*pneigh)[i] = neigh[i];
#  529|       }
#  530|   

Error: CPPCHECK_WARNING (CWE-476): [#def1470]
leptonica-1.87.0/src/pixtiling.c:159: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pt
#  157|   
#  158|       pt = (PIXTILING *)LEPT_CALLOC(1, sizeof(PIXTILING));
#  159|->     pt->pix = pixClone(pixs);
#  160|       pt->xoverlap = xoverlap;
#  161|       pt->yoverlap = yoverlap;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1471]
leptonica-1.87.0/src/pixtiling.c:159:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pt’
leptonica-1.87.0/src/pixtiling.c:135:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pixtiling.c:137:9: branch_false: ...to here
leptonica-1.87.0/src/pixtiling.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixtiling.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/pixtiling.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixtiling.c:146:5: branch_false: ...to here
leptonica-1.87.0/src/pixtiling.c:153:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixtiling.c:158:23: branch_false: ...to here
leptonica-1.87.0/src/pixtiling.c:158:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pixtiling.c:159:5: danger: ‘pt’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  157|   
#  158|       pt = (PIXTILING *)LEPT_CALLOC(1, sizeof(PIXTILING));
#  159|->     pt->pix = pixClone(pixs);
#  160|       pt->xoverlap = xoverlap;
#  161|       pt->yoverlap = yoverlap;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1472]
leptonica-1.87.0/src/pixtiling.c:159:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pt’
leptonica-1.87.0/src/pixtiling.c:135:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/pixtiling.c:137:9: branch_false: ...to here
leptonica-1.87.0/src/pixtiling.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixtiling.c:139:9: branch_false: ...to here
leptonica-1.87.0/src/pixtiling.c:139:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixtiling.c:146:5: branch_false: ...to here
leptonica-1.87.0/src/pixtiling.c:153:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pixtiling.c:158:23: branch_false: ...to here
leptonica-1.87.0/src/pixtiling.c:158:23: acquire_memory: allocated here
leptonica-1.87.0/src/pixtiling.c:159:15: throw: if ‘pixClone’ throws an exception...
leptonica-1.87.0/src/pixtiling.c:159:15: danger: ‘pt’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  157|   
#  158|       pt = (PIXTILING *)LEPT_CALLOC(1, sizeof(PIXTILING));
#  159|->     pt->pix = pixClone(pixs);
#  160|       pt->xoverlap = xoverlap;
#  161|       pt->yoverlap = yoverlap;

Error: CPPCHECK_WARNING (CWE-476): [#def1473]
leptonica-1.87.0/src/pixtiling.c:160: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pt
#  158|       pt = (PIXTILING *)LEPT_CALLOC(1, sizeof(PIXTILING));
#  159|       pt->pix = pixClone(pixs);
#  160|->     pt->xoverlap = xoverlap;
#  161|       pt->yoverlap = yoverlap;
#  162|       pt->nx = nx;

Error: CPPCHECK_WARNING (CWE-476): [#def1474]
leptonica-1.87.0/src/pixtiling.c:161: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pt
#  159|       pt->pix = pixClone(pixs);
#  160|       pt->xoverlap = xoverlap;
#  161|->     pt->yoverlap = yoverlap;
#  162|       pt->nx = nx;
#  163|       pt->ny = ny;

Error: CPPCHECK_WARNING (CWE-476): [#def1475]
leptonica-1.87.0/src/pixtiling.c:162: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pt
#  160|       pt->xoverlap = xoverlap;
#  161|       pt->yoverlap = yoverlap;
#  162|->     pt->nx = nx;
#  163|       pt->ny = ny;
#  164|       pt->w = w;

Error: CPPCHECK_WARNING (CWE-476): [#def1476]
leptonica-1.87.0/src/pixtiling.c:163: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pt
#  161|       pt->yoverlap = yoverlap;
#  162|       pt->nx = nx;
#  163|->     pt->ny = ny;
#  164|       pt->w = w;
#  165|       pt->h = h;

Error: CPPCHECK_WARNING (CWE-476): [#def1477]
leptonica-1.87.0/src/pixtiling.c:164: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pt
#  162|       pt->nx = nx;
#  163|       pt->ny = ny;
#  164|->     pt->w = w;
#  165|       pt->h = h;
#  166|       pt->strip = TRUE;

Error: CPPCHECK_WARNING (CWE-476): [#def1478]
leptonica-1.87.0/src/pixtiling.c:165: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pt
#  163|       pt->ny = ny;
#  164|       pt->w = w;
#  165|->     pt->h = h;
#  166|       pt->strip = TRUE;
#  167|       return pt;

Error: CPPCHECK_WARNING (CWE-476): [#def1479]
leptonica-1.87.0/src/pixtiling.c:166: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pt
#  164|       pt->w = w;
#  165|       pt->h = h;
#  166|->     pt->strip = TRUE;
#  167|       return pt;
#  168|   }

Error: COMPILER_WARNING: [#def1480]
leptonica-1.87.0/src/pngio.c: scope_hint: In function ‘pixReadStreamPng’
leptonica-1.87.0/src/pngio.c:191:30: warning[-Wunused-but-set-variable=]: variable ‘ncolors’ set but not used
#  191 | l_int32      i, j, k, index, ncolors, rval, gval, bval, valid;
#      |                              ^~~~~~~
#  189|   {
#  190|   l_uint8      byte;
#  191|-> l_int32      i, j, k, index, ncolors, rval, gval, bval, valid;
#  192|   l_int32      wpl, d, spp, cindex, bitval, bival, quadval, tRNS;
#  193|   l_uint32     png_transforms;

Error: CPPCHECK_WARNING (CWE-476): [#def1481]
leptonica-1.87.0/src/pngio.c:1238: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: row_pointers
# 1236|           data = pixGetData(pix1);
# 1237|           for (i = 0; i < h; i++)
# 1238|->             row_pointers[i] = (png_bytep)(data + i * wpl);
# 1239|           png_set_rows(png_ptr, info_ptr, row_pointers);
# 1240|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1482]
leptonica-1.87.0/src/pngio.c:1263:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rowbuffer’
leptonica-1.87.0/src/pngio.c:1074:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1076:8: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1076:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1079:9: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1110:8: branch_false: following ‘false’ branch (when ‘cmflag == 0’)...
leptonica-1.87.0/src/pngio.c:1119:20: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1119:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1122:21: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1122:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1128:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1130:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/pngio.c:1130:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1137:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1215:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1251:12: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1253:8: branch_false: following ‘false’ branch (when ‘d != 24’)...
leptonica-1.87.0/src/pngio.c:1259:32: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1259:32: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pngio.c:1260:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pngio.c:1261:29: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:1262:29: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pngio.c:1263:34: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:1263:17: danger: ‘rowbuffer + (sizetype)k’ could be NULL: unchecked value from [(18)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/17)
# 1261|               ppixel = data + i * wpl;
# 1262|               for (j = k = 0; j < w; j++) {
# 1263|->                 rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_RED);
# 1264|                   rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_GREEN);
# 1265|                   rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_BLUE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1483]
leptonica-1.87.0/src/pngio.c:1271:13: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/pngio.c:1074:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1076:8: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1076:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1079:9: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1110:8: branch_false: following ‘false’ branch (when ‘cmflag == 0’)...
leptonica-1.87.0/src/pngio.c:1119:20: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1119:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1122:21: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1122:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1128:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1130:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/pngio.c:1130:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1137:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1215:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1251:12: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1253:8: branch_false: following ‘false’ branch (when ‘d != 24’)...
leptonica-1.87.0/src/pngio.c:1259:32: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1259:32: acquire_memory: allocated here
leptonica-1.87.0/src/pngio.c:1260:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pngio.c:1261:29: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:1262:29: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1271:13: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1271:13: throw: if ‘png_write_rows’ throws an exception...
leptonica-1.87.0/src/pngio.c:1271:13: danger: ‘rowbuffer’ leaks here; was allocated at [(18)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/17)
# 1269|               }
# 1270|   
# 1271|->             png_write_rows(png_ptr, &rowbuffer, 1);
# 1272|           }
# 1273|           LEPT_FREE(rowbuffer);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1484]
leptonica-1.87.0/src/pngio.c:1394:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*((struct MemIOData *)last).m_Buffer’ where non-null expected
leptonica-1.87.0/src/pngio.c:1391:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pngio.c:1392:12: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:1392:12: branch_true: following ‘true’ branch (when ‘len > 8192’)...
leptonica-1.87.0/src/pngio.c:1393:38: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:1393:38: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pngio.c:1394:13: danger: argument 1 (‘malloc(len)’) from [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4) could be NULL where non-null expected
# 1392|           if (len > MEMIO_BUFFER_SIZE) {
# 1393|               last->m_Buffer = (char *)LEPT_MALLOC(len);
# 1394|->             memcpy(last->m_Buffer, data, len);
# 1395|               last->m_Size = last->m_Count = len;
# 1396|               return;

Error: CPPCHECK_WARNING (CWE-476): [#def1485]
leptonica-1.87.0/src/pngio.c:1406: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: next
# 1404|           if (last->m_Count == last->m_Size) {
# 1405|               MEMIODATA* next = (MEMIODATA *)LEPT_MALLOC(sizeof(MEMIODATA));
# 1406|->             next->m_Next = NULL;
# 1407|               next->m_Count = 0;
# 1408|               next->m_Last = next;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1486]
leptonica-1.87.0/src/pngio.c:1406:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘next’
leptonica-1.87.0/src/pngio.c:1391:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1391:8: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1403:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pngio.c:1404:13: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:1404:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pngio.c:1405:44: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:1405:44: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pngio.c:1406:13: danger: ‘next’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
# 1404|           if (last->m_Count == last->m_Size) {
# 1405|               MEMIODATA* next = (MEMIODATA *)LEPT_MALLOC(sizeof(MEMIODATA));
# 1406|->             next->m_Next = NULL;
# 1407|               next->m_Count = 0;
# 1408|               next->m_Last = next;

Error: CPPCHECK_WARNING (CWE-476): [#def1487]
leptonica-1.87.0/src/pngio.c:1407: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: next
# 1405|               MEMIODATA* next = (MEMIODATA *)LEPT_MALLOC(sizeof(MEMIODATA));
# 1406|               next->m_Next = NULL;
# 1407|->             next->m_Count = 0;
# 1408|               next->m_Last = next;
# 1409|   

Error: CPPCHECK_WARNING (CWE-476): [#def1488]
leptonica-1.87.0/src/pngio.c:1408: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: next
# 1406|               next->m_Next = NULL;
# 1407|               next->m_Count = 0;
# 1408|->             next->m_Last = next;
# 1409|   
# 1410|               last->m_Next = next;

Error: CPPCHECK_WARNING (CWE-476): [#def1489]
leptonica-1.87.0/src/pngio.c:1413: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: last
# 1411|               last = thing->m_Last = next;
# 1412|   
# 1413|->             last->m_Buffer = (char *)LEPT_MALLOC(MEMIO_BUFFER_SIZE);
# 1414|               last->m_Size = MEMIO_BUFFER_SIZE;
# 1415|           }

Error: CPPCHECK_WARNING (CWE-476): [#def1490]
leptonica-1.87.0/src/pngio.c:1414: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: last
# 1412|   
# 1413|               last->m_Buffer = (char *)LEPT_MALLOC(MEMIO_BUFFER_SIZE);
# 1414|->             last->m_Size = MEMIO_BUFFER_SIZE;
# 1415|           }
# 1416|   

Error: CPPCHECK_WARNING (CWE-476): [#def1491]
leptonica-1.87.0/src/pngio.c:1417: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: last
# 1415|           }
# 1416|   
# 1417|->         remainingSpace = last->m_Size - last->m_Count;
# 1418|           remainingToWrite = len - written;
# 1419|           if (remainingSpace < remainingToWrite) {

Error: CPPCHECK_WARNING (CWE-476): [#def1492]
leptonica-1.87.0/src/pngio.c:1467: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
# 1465|           /* Copy data to a new buffer. */
# 1466|       data = (char *)LEPT_MALLOC(amount);
# 1467|->     memcpy(data, pthing->m_Buffer, pthing->m_Count);
# 1468|       copied = pthing->m_Count;
# 1469|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1493]
leptonica-1.87.0/src/pngio.c:1467:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘data’ where non-null expected
leptonica-1.87.0/src/pngio.c:1454:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:1458:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1460:12: branch_true: following ‘true’ branch (when ‘buffer’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1461:19: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:1466:20: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pngio.c:1467:5: danger: argument 1 (‘data’) from [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4) could be NULL where non-null expected
# 1465|           /* Copy data to a new buffer. */
# 1466|       data = (char *)LEPT_MALLOC(amount);
# 1467|->     memcpy(data, pthing->m_Buffer, pthing->m_Count);
# 1468|       copied = pthing->m_Count;
# 1469|   

Error: CPPCHECK_WARNING (CWE-682): [#def1494]
leptonica-1.87.0/src/pngio.c:1478: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
# 1476|       while (buffer != NULL && copied < amount) {
# 1477|           MEMIODATA* old;
# 1478|->         memcpy(data + copied, buffer->m_Buffer, buffer->m_Count);
# 1479|           copied += buffer->m_Count;
# 1480|   

Error: COMPILER_WARNING: [#def1495]
leptonica-1.87.0/src/pngio.c: scope_hint: In function ‘pixReadMemPng’
leptonica-1.87.0/src/pngio.c:1576:30: warning[-Wunused-but-set-variable=]: variable ‘ncolors’ set but not used
# 1576 | l_int32      i, j, k, index, ncolors, rval, gval, bval, valid;
#      |                              ^~~~~~~
# 1574|   {
# 1575|   l_uint8      byte;
# 1576|-> l_int32      i, j, k, index, ncolors, rval, gval, bval, valid;
# 1577|   l_int32      wpl, d, spp, cindex, bitval, bival, quadval, tRNS;
# 1578|   l_uint32     png_transforms;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1496]
leptonica-1.87.0/src/pngio.c:2175:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rowbuffer’
leptonica-1.87.0/src/pngio.c:1983:8: branch_true: following ‘true’ branch (when ‘pfilesize’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1983:20: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:1984:8: branch_false: following ‘false’ branch (when ‘pfiledata’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1986:8: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1986:8: branch_false: following ‘false’ branch (when ‘pfilesize’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1988:8: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1988:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1991:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2028:8: branch_false: following ‘false’ branch (when ‘cmflag == 0’)...
leptonica-1.87.0/src/pngio.c:2037:20: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2037:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:2041:21: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2041:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:2047:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2048:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/pngio.c:2048:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:2054:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2126:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:2163:12: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2165:8: branch_false: following ‘false’ branch (when ‘d != 24’)...
leptonica-1.87.0/src/pngio.c:2171:32: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2171:32: acquire_memory: this call could return NULL
leptonica-1.87.0/src/pngio.c:2172:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pngio.c:2173:29: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:2174:29: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pngio.c:2175:34: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:2175:17: danger: ‘rowbuffer + (sizetype)k’ could be NULL: unchecked value from [(22)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/21)
# 2173|               ppixel = data + i * wpl;
# 2174|               for (j = k = 0; j < w; j++) {
# 2175|->                 rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_RED);
# 2176|                   rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_GREEN);
# 2177|                   rowbuffer[k++] = GET_DATA_BYTE(ppixel, COLOR_BLUE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1497]
leptonica-1.87.0/src/pngio.c:2183:13: warning[-Wanalyzer-malloc-leak]: leak of ‘rowbuffer’
leptonica-1.87.0/src/pngio.c:1983:8: branch_true: following ‘true’ branch (when ‘pfilesize’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1983:20: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:1984:8: branch_false: following ‘false’ branch (when ‘pfiledata’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1986:8: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1986:8: branch_false: following ‘false’ branch (when ‘pfilesize’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1988:8: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:1988:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pngio.c:1991:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2028:8: branch_false: following ‘false’ branch (when ‘cmflag == 0’)...
leptonica-1.87.0/src/pngio.c:2037:20: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2037:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:2041:21: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2041:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:2047:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2048:9: setjmp: ‘setjmp’ called here
leptonica-1.87.0/src/pngio.c:2048:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:2054:5: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2126:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:2163:12: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2165:8: branch_false: following ‘false’ branch (when ‘d != 24’)...
leptonica-1.87.0/src/pngio.c:2171:32: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2171:32: acquire_memory: allocated here
leptonica-1.87.0/src/pngio.c:2172:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/pngio.c:2173:29: branch_true: ...to here
leptonica-1.87.0/src/pngio.c:2174:29: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/pngio.c:2183:13: branch_false: ...to here
leptonica-1.87.0/src/pngio.c:2183:13: throw: if ‘png_write_rows’ throws an exception...
leptonica-1.87.0/src/pngio.c:2183:13: danger: ‘rowbuffer’ leaks here; was allocated at [(22)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/21)
# 2181|               }
# 2182|   
# 2183|->             png_write_rows(png_ptr, &rowbuffer, 1);
# 2184|           }
# 2185|           LEPT_FREE(rowbuffer);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1498]
leptonica-1.87.0/src/pnmio.c:751:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1218:1: enter_function: entry to ‘pixWriteMemPnm’
leptonica-1.87.0/src/pnmio.c:1226:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1226:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1227:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1229:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1229:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1231:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1231:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1235:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1235:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1235:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1237:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1237:11: call_function: calling ‘pixWriteStreamPnm’ from ‘pixWriteMemPnm’
#  749|           return ERROR_INT("pix not defined", __func__, 1);
#  750|   
#  751|->     pixGetDimensions(pix, &w, &h, &d);
#  752|       if (d != 1 && d != 2 && d != 4 && d != 8 && d != 16 && d != 24 && d != 32)
#  753|           return ERROR_INT("d not in {1,2,4,8,16,24,32}", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1499]
leptonica-1.87.0/src/pnmio.c:753:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1218:1: enter_function: entry to ‘pixWriteMemPnm’
leptonica-1.87.0/src/pnmio.c:1226:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1226:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1227:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1229:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1229:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1231:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1231:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1235:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1235:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1235:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1237:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1237:11: call_function: calling ‘pixWriteStreamPnm’ from ‘pixWriteMemPnm’
#  751|       pixGetDimensions(pix, &w, &h, &d);
#  752|       if (d != 1 && d != 2 && d != 4 && d != 8 && d != 16 && d != 24 && d != 32)
#  753|->         return ERROR_INT("d not in {1,2,4,8,16,24,32}", __func__, 1);
#  754|       if (d == 32 && pixGetSpp(pix) == 4)
#  755|           return pixWriteStreamPam(fp, pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1500]
leptonica-1.87.0/src/pnmio.c:754:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1218:1: enter_function: entry to ‘pixWriteMemPnm’
leptonica-1.87.0/src/pnmio.c:1226:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1226:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1227:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1229:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1229:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1231:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1231:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1235:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1235:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1235:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1237:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1237:11: call_function: calling ‘pixWriteStreamPnm’ from ‘pixWriteMemPnm’
#  752|       if (d != 1 && d != 2 && d != 4 && d != 8 && d != 16 && d != 24 && d != 32)
#  753|           return ERROR_INT("d not in {1,2,4,8,16,24,32}", __func__, 1);
#  754|->     if (d == 32 && pixGetSpp(pix) == 4)
#  755|           return pixWriteStreamPam(fp, pix);
#  756|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1501]
leptonica-1.87.0/src/pnmio.c:989:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1274:1: enter_function: entry to ‘pixWriteMemPam’
leptonica-1.87.0/src/pnmio.c:1282:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1282:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1283:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1291:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1291:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1291:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1293:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1293:11: call_function: calling ‘pixWriteStreamPam’ from ‘pixWriteMemPam’
#  987|           return ERROR_INT("pix not defined", __func__, 1);
#  988|   
#  989|->     pixGetDimensions(pix, &w, &h, &d);
#  990|       if (d != 1 && d != 2 && d != 4 && d != 8 && d != 16 && d != 24 && d != 32)
#  991|           return ERROR_INT("d not in {1,2,4,8,16,24,32}", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1502]
leptonica-1.87.0/src/pnmio.c:991:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1274:1: enter_function: entry to ‘pixWriteMemPam’
leptonica-1.87.0/src/pnmio.c:1282:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1282:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1283:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1291:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1291:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1291:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1293:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1293:11: call_function: calling ‘pixWriteStreamPam’ from ‘pixWriteMemPam’
#  989|       pixGetDimensions(pix, &w, &h, &d);
#  990|       if (d != 1 && d != 2 && d != 4 && d != 8 && d != 16 && d != 24 && d != 32)
#  991|->         return ERROR_INT("d not in {1,2,4,8,16,24,32}", __func__, 1);
#  992|   
#  993|           /* If a colormap exists, remove and convert to grayscale or rgb */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1503]
leptonica-1.87.0/src/pnmio.c:994:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1274:1: enter_function: entry to ‘pixWriteMemPam’
leptonica-1.87.0/src/pnmio.c:1282:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1282:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1283:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1291:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1291:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1291:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1293:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1293:11: call_function: calling ‘pixWriteStreamPam’ from ‘pixWriteMemPam’
#  992|   
#  993|           /* If a colormap exists, remove and convert to grayscale or rgb */
#  994|->     if (pixGetColormap(pix) != NULL)
#  995|           pixs = pixRemoveColormap(pix, REMOVE_CMAP_BASED_ON_SRC);
#  996|       else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1504]
leptonica-1.87.0/src/pnmio.c:995:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1274:1: enter_function: entry to ‘pixWriteMemPam’
leptonica-1.87.0/src/pnmio.c:1282:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1282:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1283:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1291:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1291:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1291:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1293:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1293:11: call_function: calling ‘pixWriteStreamPam’ from ‘pixWriteMemPam’
#  993|           /* If a colormap exists, remove and convert to grayscale or rgb */
#  994|       if (pixGetColormap(pix) != NULL)
#  995|->         pixs = pixRemoveColormap(pix, REMOVE_CMAP_BASED_ON_SRC);
#  996|       else
#  997|           pixs = pixClone(pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1505]
leptonica-1.87.0/src/pnmio.c:997:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1274:1: enter_function: entry to ‘pixWriteMemPam’
leptonica-1.87.0/src/pnmio.c:1282:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1282:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1283:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1291:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1291:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1291:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1293:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1293:11: call_function: calling ‘pixWriteStreamPam’ from ‘pixWriteMemPam’
#  995|           pixs = pixRemoveColormap(pix, REMOVE_CMAP_BASED_ON_SRC);
#  996|       else
#  997|->         pixs = pixClone(pix);
#  998|       ds = pixGetDepth(pixs);
#  999|       datas = pixGetData(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1506]
leptonica-1.87.0/src/pnmio.c:998:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1274:1: enter_function: entry to ‘pixWriteMemPam’
leptonica-1.87.0/src/pnmio.c:1282:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1282:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1283:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1291:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1291:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1291:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1293:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1293:11: call_function: calling ‘pixWriteStreamPam’ from ‘pixWriteMemPam’
#  996|       else
#  997|           pixs = pixClone(pix);
#  998|->     ds = pixGetDepth(pixs);
#  999|       datas = pixGetData(pixs);
# 1000|       wpls = pixGetWpl(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1507]
leptonica-1.87.0/src/pnmio.c:999:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1274:1: enter_function: entry to ‘pixWriteMemPam’
leptonica-1.87.0/src/pnmio.c:1282:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1282:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1283:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1291:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1291:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1291:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1293:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1293:11: call_function: calling ‘pixWriteStreamPam’ from ‘pixWriteMemPam’
#  997|           pixs = pixClone(pix);
#  998|       ds = pixGetDepth(pixs);
#  999|->     datas = pixGetData(pixs);
# 1000|       wpls = pixGetWpl(pixs);
# 1001|       spps = pixGetSpp(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1508]
leptonica-1.87.0/src/pnmio.c:1000:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/pnmio.c:1274:1: enter_function: entry to ‘pixWriteMemPam’
leptonica-1.87.0/src/pnmio.c:1282:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1282:16: branch_true: ...to here
leptonica-1.87.0/src/pnmio.c:1283:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1285:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1287:8: branch_false: following ‘false’ branch (when ‘pix’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1291:15: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1291:15: acquire_memory: allocated here
leptonica-1.87.0/src/pnmio.c:1291:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/pnmio.c:1293:11: branch_false: ...to here
leptonica-1.87.0/src/pnmio.c:1293:11: call_function: calling ‘pixWriteStreamPam’ from ‘pixWriteMemPam’
#  998|       ds = pixGetDepth(pixs);
#  999|       datas = pixGetData(pixs);
# 1000|->     wpls = pixGetWpl(pixs);
# 1001|       spps = pixGetSpp(pixs);
# 1002|       if (ds < 24)

Error: COMPILER_WARNING (CWE-563): [#def1509]
leptonica-1.87.0/src/pnmio.c: scope_hint: In function ‘pnmReadNextAsciiValue’
leptonica-1.87.0/src/pnmio.c:1330:10: warning[-Wunused-variable]: unused variable ‘ignore’
# 1330 | l_int32  ignore;
#      |          ^~~~~~
# 1328|                         l_int32  *pval)
# 1329|   {
# 1330|-> l_int32  ignore;
# 1331|   
# 1332|       if (!pval)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1510]
leptonica-1.87.0/src/projective.c:778:5: warning[-Wanalyzer-malloc-leak]: leak of ‘vc’
leptonica-1.87.0/src/projective.c:504:1: enter_function: entry to ‘pixProjectivePtaGray’
leptonica-1.87.0/src/projective.c:512:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/projective.c:514:8: branch_false: ...to here
leptonica-1.87.0/src/projective.c:514:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/projective.c:516:8: branch_false: ...to here
leptonica-1.87.0/src/projective.c:516:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/projective.c:518:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:518:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:520:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:520:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:522:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:526:5: branch_false: ...to here
leptonica-1.87.0/src/projective.c:526:5: call_function: calling ‘getProjectiveXformCoeffs’ from ‘pixProjectivePtaGray’
#  776|       b = (l_float32 *)LEPT_CALLOC(8, sizeof(l_float32));
#  777|       *pvc = b;
#  778|->     ptaGetPt(ptas, 0, &x1, &y1);
#  779|       ptaGetPt(ptas, 1, &x2, &y2);
#  780|       ptaGetPt(ptas, 2, &x3, &y3);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1511]
leptonica-1.87.0/src/projective.c:779:5: warning[-Wanalyzer-malloc-leak]: leak of ‘vc’
leptonica-1.87.0/src/projective.c:504:1: enter_function: entry to ‘pixProjectivePtaGray’
leptonica-1.87.0/src/projective.c:512:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/projective.c:514:8: branch_false: ...to here
leptonica-1.87.0/src/projective.c:514:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/projective.c:516:8: branch_false: ...to here
leptonica-1.87.0/src/projective.c:516:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/projective.c:518:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:518:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:520:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:520:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:522:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:526:5: branch_false: ...to here
leptonica-1.87.0/src/projective.c:526:5: call_function: calling ‘getProjectiveXformCoeffs’ from ‘pixProjectivePtaGray’
#  777|       *pvc = b;
#  778|       ptaGetPt(ptas, 0, &x1, &y1);
#  779|->     ptaGetPt(ptas, 1, &x2, &y2);
#  780|       ptaGetPt(ptas, 2, &x3, &y3);
#  781|       ptaGetPt(ptas, 3, &x4, &y4);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1512]
leptonica-1.87.0/src/projective.c:780:5: warning[-Wanalyzer-malloc-leak]: leak of ‘vc’
leptonica-1.87.0/src/projective.c:504:1: enter_function: entry to ‘pixProjectivePtaGray’
leptonica-1.87.0/src/projective.c:512:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/projective.c:514:8: branch_false: ...to here
leptonica-1.87.0/src/projective.c:514:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/projective.c:516:8: branch_false: ...to here
leptonica-1.87.0/src/projective.c:516:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/projective.c:518:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:518:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:520:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:520:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:522:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:526:5: branch_false: ...to here
leptonica-1.87.0/src/projective.c:526:5: call_function: calling ‘getProjectiveXformCoeffs’ from ‘pixProjectivePtaGray’
#  778|       ptaGetPt(ptas, 0, &x1, &y1);
#  779|       ptaGetPt(ptas, 1, &x2, &y2);
#  780|->     ptaGetPt(ptas, 2, &x3, &y3);
#  781|       ptaGetPt(ptas, 3, &x4, &y4);
#  782|       ptaGetPt(ptad, 0, &b[0], &b[1]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1513]
leptonica-1.87.0/src/projective.c:781:5: warning[-Wanalyzer-malloc-leak]: leak of ‘vc’
leptonica-1.87.0/src/projective.c:504:1: enter_function: entry to ‘pixProjectivePtaGray’
leptonica-1.87.0/src/projective.c:512:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/projective.c:514:8: branch_false: ...to here
leptonica-1.87.0/src/projective.c:514:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/projective.c:516:8: branch_false: ...to here
leptonica-1.87.0/src/projective.c:516:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/projective.c:518:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:518:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:520:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:520:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:522:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:526:5: branch_false: ...to here
leptonica-1.87.0/src/projective.c:526:5: call_function: calling ‘getProjectiveXformCoeffs’ from ‘pixProjectivePtaGray’
#  779|       ptaGetPt(ptas, 1, &x2, &y2);
#  780|       ptaGetPt(ptas, 2, &x3, &y3);
#  781|->     ptaGetPt(ptas, 3, &x4, &y4);
#  782|       ptaGetPt(ptad, 0, &b[0], &b[1]);
#  783|       ptaGetPt(ptad, 1, &b[2], &b[3]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1514]
leptonica-1.87.0/src/projective.c:782:5: warning[-Wanalyzer-malloc-leak]: leak of ‘vc’
leptonica-1.87.0/src/projective.c:504:1: enter_function: entry to ‘pixProjectivePtaGray’
leptonica-1.87.0/src/projective.c:512:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/projective.c:514:8: branch_false: ...to here
leptonica-1.87.0/src/projective.c:514:8: branch_false: following ‘false’ branch (when ‘ptas’ is non-NULL)...
leptonica-1.87.0/src/projective.c:516:8: branch_false: ...to here
leptonica-1.87.0/src/projective.c:516:8: branch_false: following ‘false’ branch (when ‘ptad’ is non-NULL)...
leptonica-1.87.0/src/projective.c:518:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:518:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:520:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:520:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:522:9: branch_false: ...to here
leptonica-1.87.0/src/projective.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/projective.c:526:5: branch_false: ...to here
leptonica-1.87.0/src/projective.c:526:5: call_function: calling ‘getProjectiveXformCoeffs’ from ‘pixProjectivePtaGray’
#  780|       ptaGetPt(ptas, 2, &x3, &y3);
#  781|       ptaGetPt(ptas, 3, &x4, &y4);
#  782|->     ptaGetPt(ptad, 0, &b[0], &b[1]);
#  783|       ptaGetPt(ptad, 1, &b[2], &b[3]);
#  784|       ptaGetPt(ptad, 2, &b[4], &b[5]);

Error: CPPCHECK_WARNING (CWE-476): [#def1515]
leptonica-1.87.0/src/projective.c:792: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  790|       a[0][1] = y1;
#  791|       a[0][2] = 1.;
#  792|->     a[0][6] = -x1 * b[0];
#  793|       a[0][7] = -y1 * b[0];
#  794|       a[1][3] = x1;

Error: CPPCHECK_WARNING (CWE-476): [#def1516]
leptonica-1.87.0/src/projective.c:793: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  791|       a[0][2] = 1.;
#  792|       a[0][6] = -x1 * b[0];
#  793|->     a[0][7] = -y1 * b[0];
#  794|       a[1][3] = x1;
#  795|       a[1][4] = y1;

Error: CPPCHECK_WARNING (CWE-476): [#def1517]
leptonica-1.87.0/src/projective.c:797: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  795|       a[1][4] = y1;
#  796|       a[1][5] = 1;
#  797|->     a[1][6] = -x1 * b[1];
#  798|       a[1][7] = -y1 * b[1];
#  799|       a[2][0] = x2;

Error: CPPCHECK_WARNING (CWE-476): [#def1518]
leptonica-1.87.0/src/projective.c:798: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  796|       a[1][5] = 1;
#  797|       a[1][6] = -x1 * b[1];
#  798|->     a[1][7] = -y1 * b[1];
#  799|       a[2][0] = x2;
#  800|       a[2][1] = y2;

Error: CPPCHECK_WARNING (CWE-476): [#def1519]
leptonica-1.87.0/src/projective.c:802: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  800|       a[2][1] = y2;
#  801|       a[2][2] = 1.;
#  802|->     a[2][6] = -x2 * b[2];
#  803|       a[2][7] = -y2 * b[2];
#  804|       a[3][3] = x2;

Error: CPPCHECK_WARNING (CWE-476): [#def1520]
leptonica-1.87.0/src/projective.c:803: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  801|       a[2][2] = 1.;
#  802|       a[2][6] = -x2 * b[2];
#  803|->     a[2][7] = -y2 * b[2];
#  804|       a[3][3] = x2;
#  805|       a[3][4] = y2;

Error: CPPCHECK_WARNING (CWE-476): [#def1521]
leptonica-1.87.0/src/projective.c:807: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  805|       a[3][4] = y2;
#  806|       a[3][5] = 1;
#  807|->     a[3][6] = -x2 * b[3];
#  808|       a[3][7] = -y2 * b[3];
#  809|       a[4][0] = x3;

Error: CPPCHECK_WARNING (CWE-476): [#def1522]
leptonica-1.87.0/src/projective.c:808: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  806|       a[3][5] = 1;
#  807|       a[3][6] = -x2 * b[3];
#  808|->     a[3][7] = -y2 * b[3];
#  809|       a[4][0] = x3;
#  810|       a[4][1] = y3;

Error: CPPCHECK_WARNING (CWE-476): [#def1523]
leptonica-1.87.0/src/projective.c:812: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  810|       a[4][1] = y3;
#  811|       a[4][2] = 1.;
#  812|->     a[4][6] = -x3 * b[4];
#  813|       a[4][7] = -y3 * b[4];
#  814|       a[5][3] = x3;

Error: CPPCHECK_WARNING (CWE-476): [#def1524]
leptonica-1.87.0/src/projective.c:813: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  811|       a[4][2] = 1.;
#  812|       a[4][6] = -x3 * b[4];
#  813|->     a[4][7] = -y3 * b[4];
#  814|       a[5][3] = x3;
#  815|       a[5][4] = y3;

Error: CPPCHECK_WARNING (CWE-476): [#def1525]
leptonica-1.87.0/src/projective.c:817: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  815|       a[5][4] = y3;
#  816|       a[5][5] = 1;
#  817|->     a[5][6] = -x3 * b[5];
#  818|       a[5][7] = -y3 * b[5];
#  819|       a[6][0] = x4;

Error: CPPCHECK_WARNING (CWE-476): [#def1526]
leptonica-1.87.0/src/projective.c:818: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  816|       a[5][5] = 1;
#  817|       a[5][6] = -x3 * b[5];
#  818|->     a[5][7] = -y3 * b[5];
#  819|       a[6][0] = x4;
#  820|       a[6][1] = y4;

Error: CPPCHECK_WARNING (CWE-476): [#def1527]
leptonica-1.87.0/src/projective.c:822: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  820|       a[6][1] = y4;
#  821|       a[6][2] = 1.;
#  822|->     a[6][6] = -x4 * b[6];
#  823|       a[6][7] = -y4 * b[6];
#  824|       a[7][3] = x4;

Error: CPPCHECK_WARNING (CWE-476): [#def1528]
leptonica-1.87.0/src/projective.c:823: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  821|       a[6][2] = 1.;
#  822|       a[6][6] = -x4 * b[6];
#  823|->     a[6][7] = -y4 * b[6];
#  824|       a[7][3] = x4;
#  825|       a[7][4] = y4;

Error: CPPCHECK_WARNING (CWE-476): [#def1529]
leptonica-1.87.0/src/projective.c:827: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  825|       a[7][4] = y4;
#  826|       a[7][5] = 1;
#  827|->     a[7][6] = -x4 * b[7];
#  828|       a[7][7] = -y4 * b[7];
#  829|   

Error: CPPCHECK_WARNING (CWE-476): [#def1530]
leptonica-1.87.0/src/projective.c:828: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: b
#  826|       a[7][5] = 1;
#  827|       a[7][6] = -x4 * b[7];
#  828|->     a[7][7] = -y4 * b[7];
#  829|   
#  830|       gaussjordan(a, b, 8);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1531]
leptonica-1.87.0/src/psio1.c:666:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘d’
leptonica-1.87.0/src/psio1.c:591:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/psio1.c:593:8: branch_false: ...to here
leptonica-1.87.0/src/psio1.c:593:8: branch_false: following ‘false’ branch (when ‘fileout’ is non-NULL)...
leptonica-1.87.0/src/psio1.c:595:8: branch_false: ...to here
leptonica-1.87.0/src/psio1.c:595:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/psio1.c:606:8: branch_true: following ‘true’ branch (when ‘pixm’ is non-NULL)...
leptonica-1.87.0/src/psio1.c:607:9: branch_true: ...to here
leptonica-1.87.0/src/psio1.c:608:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/psio1.c:611:21: branch_false: ...to here
leptonica-1.87.0/src/psio1.c:618:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/psio1.c:622:16: branch_false: ...to here
leptonica-1.87.0/src/psio1.c:627:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/psio1.c:647:9: branch_false: ...to here
leptonica-1.87.0/src/psio1.c:648:12: branch_true: following ‘true’ branch (when ‘pixm’ is non-NULL)...
leptonica-1.87.0/src/psio1.c:649:16: branch_true: ...to here
leptonica-1.87.0/src/psio1.c:663:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/psio1.c:664:26: branch_true: ...to here
leptonica-1.87.0/src/psio1.c:666:23: danger: use of uninitialized value ‘d’ here
#  664|                   pixmis = pixScale(pixm, imagescale, imagescale);
#  665|                   pixmi = pixInvert(NULL, pixmis);
#  666|->                 val = (d == 8) ? 0xff : 0xffffff00;
#  667|                   pixc = pixCopy(NULL, pixsc);
#  668|                   pixSetMasked(pixc, pixmi, val);  /* clear non-image part */

Error: COMPILER_WARNING (CWE-457): [#def1532]
leptonica-1.87.0/src/psio1.c: scope_hint: In function ‘pixWriteSegmentedPageToPS’
leptonica-1.87.0/src/psio1.c:666:39: warning[-Wmaybe-uninitialized]: ‘d’ may be used uninitialized
#  666 |                 val = (d == 8) ? 0xff : 0xffffff00;
#      |                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
leptonica-1.87.0/src/psio1.c:586:29: note: ‘d’ was declared here
#  586 | l_int32    alltext, notext, d, ret;
#      |                             ^
#  664|                   pixmis = pixScale(pixm, imagescale, imagescale);
#  665|                   pixmi = pixInvert(NULL, pixmis);
#  666|->                 val = (d == 8) ? 0xff : 0xffffff00;
#  667|                   pixc = pixCopy(NULL, pixsc);
#  668|                   pixSetMasked(pixc, pixmi, val);  /* clear non-image part */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1533]
leptonica-1.87.0/src/psio2.c:464:10: warning[-Wanalyzer-malloc-leak]: leak of ‘hexdata’
leptonica-1.87.0/src/psio2.c:337:1: enter_function: entry to ‘pixWriteStringPS’
leptonica-1.87.0/src/psio2.c:354:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/psio2.c:356:5: branch_false: ...to here
leptonica-1.87.0/src/psio2.c:382:28: acquire_memory: allocated here
leptonica-1.87.0/src/psio2.c:382:8: branch_false: following ‘false’ branch (when ‘hexdata’ is non-NULL)...
leptonica-1.87.0/src/psio2.c:384:9: branch_false: ...to here
leptonica-1.87.0/src/psio2.c:415:14: call_function: calling ‘generateUncompressedPS’ from ‘pixWriteStringPS’
#  462|           return (char *)ERROR_PTR("hexdata not defined", __func__, NULL);
#  463|   
#  464|->     sa = sarrayCreate(0);
#  465|       sarrayAddString(sa, "%!Adobe-PS", L_COPY);
#  466|       if (boxflag == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1534]
leptonica-1.87.0/src/psio2.c:465:5: warning[-Wanalyzer-malloc-leak]: leak of ‘hexdata’
leptonica-1.87.0/src/psio2.c:337:1: enter_function: entry to ‘pixWriteStringPS’
leptonica-1.87.0/src/psio2.c:354:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/psio2.c:356:5: branch_false: ...to here
leptonica-1.87.0/src/psio2.c:382:28: acquire_memory: allocated here
leptonica-1.87.0/src/psio2.c:382:8: branch_false: following ‘false’ branch (when ‘hexdata’ is non-NULL)...
leptonica-1.87.0/src/psio2.c:384:9: branch_false: ...to here
leptonica-1.87.0/src/psio2.c:415:14: call_function: calling ‘generateUncompressedPS’ from ‘pixWriteStringPS’
#  463|   
#  464|       sa = sarrayCreate(0);
#  465|->     sarrayAddString(sa, "%!Adobe-PS", L_COPY);
#  466|       if (boxflag == 0) {
#  467|           snprintf(bigbuf, sizeof(bigbuf),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1535]
leptonica-1.87.0/src/psio2.c:470:9: warning[-Wanalyzer-malloc-leak]: leak of ‘hexdata’
leptonica-1.87.0/src/psio2.c:337:1: enter_function: entry to ‘pixWriteStringPS’
leptonica-1.87.0/src/psio2.c:354:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/psio2.c:356:5: branch_false: ...to here
leptonica-1.87.0/src/psio2.c:382:28: acquire_memory: allocated here
leptonica-1.87.0/src/psio2.c:382:8: branch_false: following ‘false’ branch (when ‘hexdata’ is non-NULL)...
leptonica-1.87.0/src/psio2.c:384:9: branch_false: ...to here
leptonica-1.87.0/src/psio2.c:415:14: call_function: calling ‘generateUncompressedPS’ from ‘pixWriteStringPS’
#  468|                    "%%%%BoundingBox: %7.2f %7.2f %7.2f %7.2f",
#  469|                    xpt, ypt, xpt + wpt, ypt + hpt);
#  470|->         sarrayAddString(sa, bigbuf, L_COPY);
#  471|       } else {  /* boxflag == 1 */
#  472|           sarrayAddString(sa, "gsave", L_COPY);

Error: CPPCHECK_WARNING (CWE-476): [#def1536]
leptonica-1.87.0/src/ptabasic.c:128: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pta
#  126|   
#  127|       pta = (PTA *)LEPT_CALLOC(1, sizeof(PTA));
#  128|->     pta->n = 0;
#  129|       pta->nalloc = n;
#  130|       pta->refcount = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1537]
leptonica-1.87.0/src/ptabasic.c:128:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pta’
leptonica-1.87.0/src/ptabasic.c:219:1: enter_function: entry to ‘ptaCopy’
leptonica-1.87.0/src/ptabasic.c:228:17: call_function: calling ‘ptaCreate’ from ‘ptaCopy’
#  126|   
#  127|       pta = (PTA *)LEPT_CALLOC(1, sizeof(PTA));
#  128|->     pta->n = 0;
#  129|       pta->nalloc = n;
#  130|       pta->refcount = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def1538]
leptonica-1.87.0/src/ptabasic.c:129: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pta
#  127|       pta = (PTA *)LEPT_CALLOC(1, sizeof(PTA));
#  128|       pta->n = 0;
#  129|->     pta->nalloc = n;
#  130|       pta->refcount = 1;
#  131|       pta->x = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32));

Error: CPPCHECK_WARNING (CWE-476): [#def1539]
leptonica-1.87.0/src/ptabasic.c:130: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pta
#  128|       pta->n = 0;
#  129|       pta->nalloc = n;
#  130|->     pta->refcount = 1;
#  131|       pta->x = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32));
#  132|       pta->y = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32));

Error: CPPCHECK_WARNING (CWE-476): [#def1540]
leptonica-1.87.0/src/ptabasic.c:131: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pta
#  129|       pta->nalloc = n;
#  130|       pta->refcount = 1;
#  131|->     pta->x = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32));
#  132|       pta->y = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32));
#  133|       if (!pta->x || !pta->y) {

Error: CPPCHECK_WARNING (CWE-476): [#def1541]
leptonica-1.87.0/src/ptabasic.c:132: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pta
#  130|       pta->refcount = 1;
#  131|       pta->x = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32));
#  132|->     pta->y = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32));
#  133|       if (!pta->x || !pta->y) {
#  134|           ptaDestroy(&pta);

Error: CPPCHECK_WARNING (CWE-476): [#def1542]
leptonica-1.87.0/src/ptabasic.c:133: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pta
#  131|       pta->x = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32));
#  132|       pta->y = (l_float32 *)LEPT_CALLOC(n, sizeof(l_float32));
#  133|->     if (!pta->x || !pta->y) {
#  134|           ptaDestroy(&pta);
#  135|           return (PTA *)ERROR_PTR("x and y arrays not both made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1543]
leptonica-1.87.0/src/ptabasic.c:289:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/ptabasic.c:1472:1: enter_function: entry to ‘ptaaWriteMem’
leptonica-1.87.0/src/ptabasic.c:1481:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/ptabasic.c:1481:16: branch_true: ...to here
leptonica-1.87.0/src/ptabasic.c:1482:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/ptabasic.c:1484:8: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1484:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/ptabasic.c:1486:8: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1486:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptabasic.c:1490:15: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1490:15: acquire_memory: allocated here
leptonica-1.87.0/src/ptabasic.c:1490:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/ptabasic.c:1492:11: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1492:11: call_function: calling ‘ptaaWriteStream’ from ‘ptaaWriteMem’
#  287|   {
#  288|       if (!pta)
#  289|->         return (PTA *)ERROR_PTR("pta not defined", __func__, NULL);
#  290|   
#  291|       ++pta->refcount;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1544]
leptonica-1.87.0/src/ptabasic.c:817:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/ptabasic.c:1472:1: enter_function: entry to ‘ptaaWriteMem’
leptonica-1.87.0/src/ptabasic.c:1481:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/ptabasic.c:1481:16: branch_true: ...to here
leptonica-1.87.0/src/ptabasic.c:1482:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/ptabasic.c:1484:8: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1484:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/ptabasic.c:1486:8: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1486:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptabasic.c:1490:15: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1490:15: acquire_memory: allocated here
leptonica-1.87.0/src/ptabasic.c:1490:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/ptabasic.c:1492:11: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1492:11: call_function: calling ‘ptaaWriteStream’ from ‘ptaaWriteMem’
#  815|           return ERROR_INT("stream not defined", __func__, 1);
#  816|       if (!pta)
#  817|->         return ERROR_INT("pta not defined", __func__, 1);
#  818|   
#  819|       n = ptaGetCount(pta);

Error: CPPCHECK_WARNING (CWE-476): [#def1545]
leptonica-1.87.0/src/ptabasic.c:914: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ptaa
#  912|   
#  913|       ptaa = (PTAA *)LEPT_CALLOC(1, sizeof(PTAA));
#  914|->     ptaa->n = 0;
#  915|       ptaa->nalloc = n;
#  916|       if ((ptaa->pta = (PTA **)LEPT_CALLOC(n, sizeof(PTA *))) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1546]
leptonica-1.87.0/src/ptabasic.c:914:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ptaa’
leptonica-1.87.0/src/ptabasic.c:1300:1: enter_function: entry to ‘ptaaReadStream’
leptonica-1.87.0/src/ptabasic.c:1309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptabasic.c:1311:9: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1311:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptabasic.c:1313:9: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1313:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptabasic.c:1315:9: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1315:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptabasic.c:1317:8: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1317:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptabasic.c:1319:8: branch_false: ...to here
leptonica-1.87.0/src/ptabasic.c:1321:17: call_function: calling ‘ptaaCreate’ from ‘ptaaReadStream’
#  912|   
#  913|       ptaa = (PTAA *)LEPT_CALLOC(1, sizeof(PTAA));
#  914|->     ptaa->n = 0;
#  915|       ptaa->nalloc = n;
#  916|       if ((ptaa->pta = (PTA **)LEPT_CALLOC(n, sizeof(PTA *))) == NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def1547]
leptonica-1.87.0/src/ptabasic.c:915: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ptaa
#  913|       ptaa = (PTAA *)LEPT_CALLOC(1, sizeof(PTAA));
#  914|       ptaa->n = 0;
#  915|->     ptaa->nalloc = n;
#  916|       if ((ptaa->pta = (PTA **)LEPT_CALLOC(n, sizeof(PTA *))) == NULL) {
#  917|           ptaaDestroy(&ptaa);

Error: CPPCHECK_WARNING (CWE-476): [#def1548]
leptonica-1.87.0/src/ptabasic.c:916: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ptaa
#  914|       ptaa->n = 0;
#  915|       ptaa->nalloc = n;
#  916|->     if ((ptaa->pta = (PTA **)LEPT_CALLOC(n, sizeof(PTA *))) == NULL) {
#  917|           ptaaDestroy(&ptaa);
#  918|           return (PTAA *)ERROR_PTR("pta ptrs not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1549]
leptonica-1.87.0/src/ptafunc1.c:1208:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[0]’
leptonica-1.87.0/src/ptafunc1.c:1626:1: enter_function: entry to ‘ptaNoisyQuadraticLSF’
leptonica-1.87.0/src/ptafunc1.c:1640:8: branch_true: following ‘true’ branch (when ‘pptad’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1640:16: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1641:8: branch_false: following ‘false’ branch (when ‘pa’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: following ‘false’ branch (when ‘pb’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: following ‘false’ branch (when ‘pc’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: following ‘false’ branch (when ‘pmederr’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_true: following ‘true’ branch (when ‘pnafit’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:17: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1646:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: following ‘false’ branch (when ‘factor > 0.0f’)...
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1652:14: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1652:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1655:9: call_function: calling ‘ptaGetQuadraticLSF’ from ‘ptaNoisyQuadraticLSF’
# 1206|       for (i = 0; i < 3; i++)
# 1207|           f[i] = (l_float32 *)LEPT_CALLOC(3, sizeof(l_float32));
# 1208|->     f[0][0] = sx4;
# 1209|       f[0][1] = sx3;
# 1210|       f[0][2] = sx2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1550]
leptonica-1.87.0/src/ptafunc1.c:1211:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[1]’
leptonica-1.87.0/src/ptafunc1.c:1626:1: enter_function: entry to ‘ptaNoisyQuadraticLSF’
leptonica-1.87.0/src/ptafunc1.c:1640:8: branch_true: following ‘true’ branch (when ‘pptad’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1640:16: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1641:8: branch_false: following ‘false’ branch (when ‘pa’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: following ‘false’ branch (when ‘pb’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: following ‘false’ branch (when ‘pc’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: following ‘false’ branch (when ‘pmederr’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_true: following ‘true’ branch (when ‘pnafit’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:17: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1646:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: following ‘false’ branch (when ‘factor > 0.0f’)...
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1652:14: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1652:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1655:9: call_function: calling ‘ptaGetQuadraticLSF’ from ‘ptaNoisyQuadraticLSF’
# 1209|       f[0][1] = sx3;
# 1210|       f[0][2] = sx2;
# 1211|->     f[1][0] = sx3;
# 1212|       f[1][1] = sx2;
# 1213|       f[1][2] = sx;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1551]
leptonica-1.87.0/src/ptafunc1.c:1214:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘f[2]’
leptonica-1.87.0/src/ptafunc1.c:1626:1: enter_function: entry to ‘ptaNoisyQuadraticLSF’
leptonica-1.87.0/src/ptafunc1.c:1640:8: branch_true: following ‘true’ branch (when ‘pptad’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1640:16: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1641:8: branch_false: following ‘false’ branch (when ‘pa’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: following ‘false’ branch (when ‘pb’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: following ‘false’ branch (when ‘pc’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: following ‘false’ branch (when ‘pmederr’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_true: following ‘true’ branch (when ‘pnafit’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:17: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1646:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: following ‘false’ branch (when ‘factor > 0.0f’)...
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1652:14: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1652:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1655:9: call_function: calling ‘ptaGetQuadraticLSF’ from ‘ptaNoisyQuadraticLSF’
# 1212|       f[1][1] = sx2;
# 1213|       f[1][2] = sx;
# 1214|->     f[2][0] = sx2;
# 1215|       f[2][1] = sx;
# 1216|       f[2][2] = n;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1552]
leptonica-1.87.0/src/ptafunc1.c:1222:11: warning[-Wanalyzer-malloc-leak]: leak of ‘f[0]’
leptonica-1.87.0/src/ptafunc1.c:1626:1: enter_function: entry to ‘ptaNoisyQuadraticLSF’
leptonica-1.87.0/src/ptafunc1.c:1640:8: branch_true: following ‘true’ branch (when ‘pptad’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1640:16: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1641:8: branch_false: following ‘false’ branch (when ‘pa’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: following ‘false’ branch (when ‘pb’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: following ‘false’ branch (when ‘pc’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: following ‘false’ branch (when ‘pmederr’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_true: following ‘true’ branch (when ‘pnafit’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:17: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1646:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: following ‘false’ branch (when ‘factor > 0.0f’)...
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1652:14: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1652:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1655:9: call_function: calling ‘ptaGetQuadraticLSF’ from ‘ptaNoisyQuadraticLSF’
# 1220|   
# 1221|           /* Solve for the unknowns, also putting f-inverse into f */
# 1222|->     ret = gaussjordan(f, g, 3);
# 1223|       for (i = 0; i < 3; i++)
# 1224|           LEPT_FREE(f[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1553]
leptonica-1.87.0/src/ptafunc1.c:1222:11: warning[-Wanalyzer-malloc-leak]: leak of ‘f[1]’
leptonica-1.87.0/src/ptafunc1.c:1626:1: enter_function: entry to ‘ptaNoisyQuadraticLSF’
leptonica-1.87.0/src/ptafunc1.c:1640:8: branch_true: following ‘true’ branch (when ‘pptad’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1640:16: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1641:8: branch_false: following ‘false’ branch (when ‘pa’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: following ‘false’ branch (when ‘pb’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: following ‘false’ branch (when ‘pc’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: following ‘false’ branch (when ‘pmederr’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_true: following ‘true’ branch (when ‘pnafit’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:17: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1646:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: following ‘false’ branch (when ‘factor > 0.0f’)...
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1652:14: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1652:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1655:9: call_function: calling ‘ptaGetQuadraticLSF’ from ‘ptaNoisyQuadraticLSF’
# 1220|   
# 1221|           /* Solve for the unknowns, also putting f-inverse into f */
# 1222|->     ret = gaussjordan(f, g, 3);
# 1223|       for (i = 0; i < 3; i++)
# 1224|           LEPT_FREE(f[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1554]
leptonica-1.87.0/src/ptafunc1.c:1222:11: warning[-Wanalyzer-malloc-leak]: leak of ‘f[2]’
leptonica-1.87.0/src/ptafunc1.c:1626:1: enter_function: entry to ‘ptaNoisyQuadraticLSF’
leptonica-1.87.0/src/ptafunc1.c:1640:8: branch_true: following ‘true’ branch (when ‘pptad’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1640:16: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1641:8: branch_false: following ‘false’ branch (when ‘pa’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1642:8: branch_false: following ‘false’ branch (when ‘pb’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1643:8: branch_false: following ‘false’ branch (when ‘pc’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1644:8: branch_false: following ‘false’ branch (when ‘pmederr’ is NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1645:8: branch_true: following ‘true’ branch (when ‘pnafit’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1645:17: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:1646:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1648:8: branch_false: following ‘false’ branch (when ‘factor > 0.0f’)...
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1650:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:1652:14: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1652:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:1655:9: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:1655:9: call_function: calling ‘ptaGetQuadraticLSF’ from ‘ptaNoisyQuadraticLSF’
# 1220|   
# 1221|           /* Solve for the unknowns, also putting f-inverse into f */
# 1222|->     ret = gaussjordan(f, g, 3);
# 1223|       for (i = 0; i < 3; i++)
# 1224|           LEPT_FREE(f[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1555]
leptonica-1.87.0/src/ptafunc1.c:2613:11: warning[-Wanalyzer-malloc-leak]: leak of ‘pixela’
leptonica-1.87.0/src/ptafunc1.c:2596:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2600:12: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2601:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2604:17: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2604:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2606:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2609:31: acquire_memory: allocated here
leptonica-1.87.0/src/ptafunc1.c:2609:8: branch_false: following ‘false’ branch (when ‘pixela’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2613:11: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2613:11: throw: if ‘numaPseudorandomSequence’ throws an exception...
leptonica-1.87.0/src/ptafunc1.c:2613:11: danger: ‘pixela’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
# 2611|           return (PIX *)ERROR_PTR("calloc fail for pixela", __func__, NULL);
# 2612|       }
# 2613|->     na1 = numaPseudorandomSequence(256, 14657);
# 2614|       na2 = numaPseudorandomSequence(256, 34631);
# 2615|       na3 = numaPseudorandomSequence(256, 54617);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1556]
leptonica-1.87.0/src/ptafunc1.c:2614:11: warning[-Wanalyzer-malloc-leak]: leak of ‘pixela’
leptonica-1.87.0/src/ptafunc1.c:2596:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2600:12: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2601:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2604:17: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2604:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2606:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2609:31: acquire_memory: allocated here
leptonica-1.87.0/src/ptafunc1.c:2609:8: branch_false: following ‘false’ branch (when ‘pixela’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2613:11: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2614:11: throw: if ‘numaPseudorandomSequence’ throws an exception...
leptonica-1.87.0/src/ptafunc1.c:2614:11: danger: ‘pixela’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
# 2612|       }
# 2613|       na1 = numaPseudorandomSequence(256, 14657);
# 2614|->     na2 = numaPseudorandomSequence(256, 34631);
# 2615|       na3 = numaPseudorandomSequence(256, 54617);
# 2616|       for (i = 0; i < npta; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1557]
leptonica-1.87.0/src/ptafunc1.c:2615:11: warning[-Wanalyzer-malloc-leak]: leak of ‘pixela’
leptonica-1.87.0/src/ptafunc1.c:2596:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2600:12: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2601:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2604:17: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2604:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2606:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2609:31: acquire_memory: allocated here
leptonica-1.87.0/src/ptafunc1.c:2609:8: branch_false: following ‘false’ branch (when ‘pixela’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2613:11: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2615:11: throw: if ‘numaPseudorandomSequence’ throws an exception...
leptonica-1.87.0/src/ptafunc1.c:2615:11: danger: ‘pixela’ leaks here; was allocated at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
# 2613|       na1 = numaPseudorandomSequence(256, 14657);
# 2614|       na2 = numaPseudorandomSequence(256, 34631);
# 2615|->     na3 = numaPseudorandomSequence(256, 54617);
# 2616|       for (i = 0; i < npta; i++) {
# 2617|           numaGetIValue(na1, i % 256, &rv);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1558]
leptonica-1.87.0/src/ptafunc1.c:2617:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixela’
leptonica-1.87.0/src/ptafunc1.c:2596:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2600:12: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2601:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2604:17: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2604:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2606:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2609:31: acquire_memory: allocated here
leptonica-1.87.0/src/ptafunc1.c:2609:8: branch_false: following ‘false’ branch (when ‘pixela’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2613:11: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2616:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ptafunc1.c:2617:28: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:2617:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/ptafunc1.c:2617:9: danger: ‘pixela’ leaks here; was allocated at [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8)
# 2615|       na3 = numaPseudorandomSequence(256, 54617);
# 2616|       for (i = 0; i < npta; i++) {
# 2617|->         numaGetIValue(na1, i % 256, &rv);
# 2618|           numaGetIValue(na2, i % 256, &gv);
# 2619|           numaGetIValue(na3, i % 256, &bv);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1559]
leptonica-1.87.0/src/ptafunc1.c:2618:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixela’
leptonica-1.87.0/src/ptafunc1.c:2596:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2600:12: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2601:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2604:17: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2604:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2606:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2609:31: acquire_memory: allocated here
leptonica-1.87.0/src/ptafunc1.c:2609:8: branch_false: following ‘false’ branch (when ‘pixela’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2613:11: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2616:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ptafunc1.c:2617:28: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:2618:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/ptafunc1.c:2618:9: danger: ‘pixela’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
# 2616|       for (i = 0; i < npta; i++) {
# 2617|           numaGetIValue(na1, i % 256, &rv);
# 2618|->         numaGetIValue(na2, i % 256, &gv);
# 2619|           numaGetIValue(na3, i % 256, &bv);
# 2620|           composeRGBPixel(rv, gv, bv, &pixela[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1560]
leptonica-1.87.0/src/ptafunc1.c:2619:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixela’
leptonica-1.87.0/src/ptafunc1.c:2596:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2600:12: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2601:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2604:17: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2604:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2606:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2609:31: acquire_memory: allocated here
leptonica-1.87.0/src/ptafunc1.c:2609:8: branch_false: following ‘false’ branch (when ‘pixela’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2613:11: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2616:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ptafunc1.c:2617:28: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:2619:9: throw: if ‘numaGetIValue’ throws an exception...
leptonica-1.87.0/src/ptafunc1.c:2619:9: danger: ‘pixela’ leaks here; was allocated at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
# 2617|           numaGetIValue(na1, i % 256, &rv);
# 2618|           numaGetIValue(na2, i % 256, &gv);
# 2619|->         numaGetIValue(na3, i % 256, &bv);
# 2620|           composeRGBPixel(rv, gv, bv, &pixela[i]);
# 2621|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1561]
leptonica-1.87.0/src/ptafunc1.c:2620:9: warning[-Wanalyzer-malloc-leak]: leak of ‘pixela’
leptonica-1.87.0/src/ptafunc1.c:2596:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2600:12: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2601:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2604:17: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2604:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2606:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2609:31: acquire_memory: allocated here
leptonica-1.87.0/src/ptafunc1.c:2609:8: branch_false: following ‘false’ branch (when ‘pixela’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2613:11: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2616:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/ptafunc1.c:2617:28: branch_true: ...to here
leptonica-1.87.0/src/ptafunc1.c:2620:9: throw: if ‘composeRGBPixel’ throws an exception...
leptonica-1.87.0/src/ptafunc1.c:2620:9: danger: ‘pixela’ leaks here; was allocated at [(9)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/8)
# 2618|           numaGetIValue(na2, i % 256, &gv);
# 2619|           numaGetIValue(na3, i % 256, &bv);
# 2620|->         composeRGBPixel(rv, gv, bv, &pixela[i]);
# 2621|       }
# 2622|       numaDestroy(&na1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1562]
leptonica-1.87.0/src/ptafunc1.c:2622:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pixela’
leptonica-1.87.0/src/ptafunc1.c:2596:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2600:12: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2601:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2604:17: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2604:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2606:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2609:31: acquire_memory: allocated here
leptonica-1.87.0/src/ptafunc1.c:2609:8: branch_false: following ‘false’ branch (when ‘pixela’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2613:11: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2622:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2622:5: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/ptafunc1.c:2622:5: danger: ‘pixela’ leaks here; was allocated at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
# 2620|           composeRGBPixel(rv, gv, bv, &pixela[i]);
# 2621|       }
# 2622|->     numaDestroy(&na1);
# 2623|       numaDestroy(&na2);
# 2624|       numaDestroy(&na3);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1563]
leptonica-1.87.0/src/ptafunc1.c:2623:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pixela’
leptonica-1.87.0/src/ptafunc1.c:2596:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2600:12: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2601:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2604:17: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2604:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2606:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2609:31: acquire_memory: allocated here
leptonica-1.87.0/src/ptafunc1.c:2609:8: branch_false: following ‘false’ branch (when ‘pixela’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2613:11: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2622:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2623:5: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/ptafunc1.c:2623:5: danger: ‘pixela’ leaks here; was allocated at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8)
# 2621|       }
# 2622|       numaDestroy(&na1);
# 2623|->     numaDestroy(&na2);
# 2624|       numaDestroy(&na3);
# 2625|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1564]
leptonica-1.87.0/src/ptafunc1.c:2624:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pixela’
leptonica-1.87.0/src/ptafunc1.c:2596:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2598:8: branch_false: following ‘false’ branch (when ‘ptaa’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2600:12: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2601:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2604:17: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2604:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2606:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2609:31: acquire_memory: allocated here
leptonica-1.87.0/src/ptafunc1.c:2609:8: branch_false: following ‘false’ branch (when ‘pixela’ is non-NULL)...
leptonica-1.87.0/src/ptafunc1.c:2613:11: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2616:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/ptafunc1.c:2622:5: branch_false: ...to here
leptonica-1.87.0/src/ptafunc1.c:2624:5: throw: if ‘numaDestroy’ throws an exception...
leptonica-1.87.0/src/ptafunc1.c:2624:5: danger: ‘pixela’ leaks here; was allocated at [(9)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/8)
# 2622|       numaDestroy(&na1);
# 2623|       numaDestroy(&na2);
# 2624|->     numaDestroy(&na3);
# 2625|   
# 2626|       for (i = 0; i < npta; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def1565]
leptonica-1.87.0/src/ptra.c:155: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pa
#  153|   
#  154|       pa = (L_PTRA *)LEPT_CALLOC(1, sizeof(L_PTRA));
#  155|->     if ((pa->array = (void **)LEPT_CALLOC(n, sizeof(void *))) == NULL) {
#  156|           ptraDestroy(&pa, 0, 0);
#  157|           return (L_PTRA *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1566]
leptonica-1.87.0/src/ptra.c:155:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pa’
leptonica-1.87.0/src/ptra.c:950:1: enter_function: entry to ‘ptraaFlattenToPtra’
leptonica-1.87.0/src/ptra.c:955:8: branch_false: following ‘false’ branch (when ‘paa’ is non-NULL)...
leptonica-1.87.0/src/ptra.c:958:11: branch_false: ...to here
leptonica-1.87.0/src/ptra.c:958:11: call_function: calling ‘ptraCreate’ from ‘ptraaFlattenToPtra’
#  153|   
#  154|       pa = (L_PTRA *)LEPT_CALLOC(1, sizeof(L_PTRA));
#  155|->     if ((pa->array = (void **)LEPT_CALLOC(n, sizeof(void *))) == NULL) {
#  156|           ptraDestroy(&pa, 0, 0);
#  157|           return (L_PTRA *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def1567]
leptonica-1.87.0/src/ptra.c:159: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pa
#  157|           return (L_PTRA *)ERROR_PTR("ptr array not made", __func__, NULL);
#  158|       }
#  159|->     pa->nalloc = n;
#  160|       pa->imax = -1;
#  161|       pa->nactual = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def1568]
leptonica-1.87.0/src/ptra.c:160: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pa
#  158|       }
#  159|       pa->nalloc = n;
#  160|->     pa->imax = -1;
#  161|       pa->nactual = 0;
#  162|       return pa;

Error: CPPCHECK_WARNING (CWE-476): [#def1569]
leptonica-1.87.0/src/ptra.c:161: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pa
#  159|       pa->nalloc = n;
#  160|       pa->imax = -1;
#  161|->     pa->nactual = 0;
#  162|       return pa;
#  163|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1570]
leptonica-1.87.0/src/ptra.c:776: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: paa
#  774|   
#  775|       paa = (L_PTRAA *)LEPT_CALLOC(1, sizeof(L_PTRAA));
#  776|->     if ((paa->ptra = (L_PTRA **)LEPT_CALLOC(n, sizeof(L_PTRA *))) == NULL) {
#  777|           ptraaDestroy(&paa, 0, 0);
#  778|           return (L_PTRAA *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1571]
leptonica-1.87.0/src/ptra.c:776:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘paa’
leptonica-1.87.0/src/ptra.c:772:8: branch_false: following ‘false’ branch (when ‘n > 0’)...
leptonica-1.87.0/src/ptra.c:775:22: branch_false: ...to here
leptonica-1.87.0/src/ptra.c:775:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/ptra.c:776:9: danger: ‘calloc(1, 16)’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  774|   
#  775|       paa = (L_PTRAA *)LEPT_CALLOC(1, sizeof(L_PTRAA));
#  776|->     if ((paa->ptra = (L_PTRA **)LEPT_CALLOC(n, sizeof(L_PTRA *))) == NULL) {
#  777|           ptraaDestroy(&paa, 0, 0);
#  778|           return (L_PTRAA *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def1572]
leptonica-1.87.0/src/ptra.c:780: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: paa
#  778|           return (L_PTRAA *)ERROR_PTR("ptr array not made", __func__, NULL);
#  779|       }
#  780|->     paa->nalloc = n;
#  781|       return paa;
#  782|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1573]
leptonica-1.87.0/src/quadtree.c:471: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: xstart
#  469|           nside = 1 << k;  /* number of boxes in each direction */
#  470|           for (i = 0; i < nside; i++) {
#  471|->             xstart[i] = (w - 1) * i / nside;
#  472|               if (i > 0) xstart[i]++;
#  473|               xend[i] = (w - 1) * (i + 1) / nside;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1574]
leptonica-1.87.0/src/quadtree.c:471:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xstart’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:464:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:471:13: danger: ‘xstart + (long unsigned int)i * 4’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  469|           nside = 1 << k;  /* number of boxes in each direction */
#  470|           for (i = 0; i < nside; i++) {
#  471|->             xstart[i] = (w - 1) * i / nside;
#  472|               if (i > 0) xstart[i]++;
#  473|               xend[i] = (w - 1) * (i + 1) / nside;

Error: CPPCHECK_WARNING (CWE-476): [#def1575]
leptonica-1.87.0/src/quadtree.c:473: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: xend
#  471|               xstart[i] = (w - 1) * i / nside;
#  472|               if (i > 0) xstart[i]++;
#  473|->             xend[i] = (w - 1) * (i + 1) / nside;
#  474|               ystart[i] = (h - 1) * i / nside;
#  475|               if (i > 0) ystart[i]++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1576]
leptonica-1.87.0/src/quadtree.c:473:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xend’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:465:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:473:13: danger: ‘xend + (long unsigned int)i * 4’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  471|               xstart[i] = (w - 1) * i / nside;
#  472|               if (i > 0) xstart[i]++;
#  473|->             xend[i] = (w - 1) * (i + 1) / nside;
#  474|               ystart[i] = (h - 1) * i / nside;
#  475|               if (i > 0) ystart[i]++;

Error: CPPCHECK_WARNING (CWE-476): [#def1577]
leptonica-1.87.0/src/quadtree.c:474: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ystart
#  472|               if (i > 0) xstart[i]++;
#  473|               xend[i] = (w - 1) * (i + 1) / nside;
#  474|->             ystart[i] = (h - 1) * i / nside;
#  475|               if (i > 0) ystart[i]++;
#  476|               yend[i] = (h - 1) * (i + 1) / nside;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1578]
leptonica-1.87.0/src/quadtree.c:474:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ystart’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:466:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:474:13: danger: ‘ystart + (long unsigned int)i * 4’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  472|               if (i > 0) xstart[i]++;
#  473|               xend[i] = (w - 1) * (i + 1) / nside;
#  474|->             ystart[i] = (h - 1) * i / nside;
#  475|               if (i > 0) ystart[i]++;
#  476|               yend[i] = (h - 1) * (i + 1) / nside;

Error: CPPCHECK_WARNING (CWE-476): [#def1579]
leptonica-1.87.0/src/quadtree.c:476: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: yend
#  474|               ystart[i] = (h - 1) * i / nside;
#  475|               if (i > 0) ystart[i]++;
#  476|->             yend[i] = (h - 1) * (i + 1) / nside;
#  477|   #if DEBUG_BOXES
#  478|               lept_stderr(

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1580]
leptonica-1.87.0/src/quadtree.c:476:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘yend’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:467:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:476:13: danger: ‘yend + (long unsigned int)i * 4’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  474|               ystart[i] = (h - 1) * i / nside;
#  475|               if (i > 0) ystart[i]++;
#  476|->             yend[i] = (h - 1) * (i + 1) / nside;
#  477|   #if DEBUG_BOXES
#  478|               lept_stderr(

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1581]
leptonica-1.87.0/src/quadtree.c:484:16: warning[-Wanalyzer-malloc-leak]: leak of ‘xend’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:465:23: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:484:16: throw: if ‘boxaCreate’ throws an exception...
leptonica-1.87.0/src/quadtree.c:484:16: danger: ‘xend’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  482|           }
#  483|           nbox = 1 << (2 * k);
#  484|->         boxa = boxaCreate(nbox);
#  485|           for (i = 0; i < nside; i++) {
#  486|               bh = yend[i] - ystart[i] + 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1582]
leptonica-1.87.0/src/quadtree.c:484:16: warning[-Wanalyzer-malloc-leak]: leak of ‘xstart’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:464:25: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:484:16: throw: if ‘boxaCreate’ throws an exception...
leptonica-1.87.0/src/quadtree.c:484:16: danger: ‘xstart’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  482|           }
#  483|           nbox = 1 << (2 * k);
#  484|->         boxa = boxaCreate(nbox);
#  485|           for (i = 0; i < nside; i++) {
#  486|               bh = yend[i] - ystart[i] + 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1583]
leptonica-1.87.0/src/quadtree.c:484:16: warning[-Wanalyzer-malloc-leak]: leak of ‘yend’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:467:23: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:484:16: throw: if ‘boxaCreate’ throws an exception...
leptonica-1.87.0/src/quadtree.c:484:16: danger: ‘yend’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
#  482|           }
#  483|           nbox = 1 << (2 * k);
#  484|->         boxa = boxaCreate(nbox);
#  485|           for (i = 0; i < nside; i++) {
#  486|               bh = yend[i] - ystart[i] + 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1584]
leptonica-1.87.0/src/quadtree.c:484:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ystart’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:466:25: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:484:16: throw: if ‘boxaCreate’ throws an exception...
leptonica-1.87.0/src/quadtree.c:484:16: danger: ‘ystart’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
#  482|           }
#  483|           nbox = 1 << (2 * k);
#  484|->         boxa = boxaCreate(nbox);
#  485|           for (i = 0; i < nside; i++) {
#  486|               bh = yend[i] - ystart[i] + 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1585]
leptonica-1.87.0/src/quadtree.c:489:23: warning[-Wanalyzer-malloc-leak]: leak of ‘xend’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:465:23: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:489:23: throw: if ‘boxCreate’ throws an exception...
leptonica-1.87.0/src/quadtree.c:489:23: danger: ‘xend’ leaks here; was allocated at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
#  487|               for (j = 0; j < nside; j++) {
#  488|                   bw = xend[j] - xstart[j] + 1;
#  489|->                 box = boxCreate(xstart[j], ystart[i], bw, bh);
#  490|                   boxaAddBox(boxa, box, L_INSERT);
#  491|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1586]
leptonica-1.87.0/src/quadtree.c:489:23: warning[-Wanalyzer-malloc-leak]: leak of ‘xstart’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:464:25: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:489:23: throw: if ‘boxCreate’ throws an exception...
leptonica-1.87.0/src/quadtree.c:489:23: danger: ‘xstart’ leaks here; was allocated at [(7)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/6)
#  487|               for (j = 0; j < nside; j++) {
#  488|                   bw = xend[j] - xstart[j] + 1;
#  489|->                 box = boxCreate(xstart[j], ystart[i], bw, bh);
#  490|                   boxaAddBox(boxa, box, L_INSERT);
#  491|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1587]
leptonica-1.87.0/src/quadtree.c:489:23: warning[-Wanalyzer-malloc-leak]: leak of ‘yend’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:467:23: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:489:23: throw: if ‘boxCreate’ throws an exception...
leptonica-1.87.0/src/quadtree.c:489:23: danger: ‘yend’ leaks here; was allocated at [(7)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/6)
#  487|               for (j = 0; j < nside; j++) {
#  488|                   bw = xend[j] - xstart[j] + 1;
#  489|->                 box = boxCreate(xstart[j], ystart[i], bw, bh);
#  490|                   boxaAddBox(boxa, box, L_INSERT);
#  491|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1588]
leptonica-1.87.0/src/quadtree.c:489:23: warning[-Wanalyzer-malloc-leak]: leak of ‘ystart’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:466:25: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:489:23: throw: if ‘boxCreate’ throws an exception...
leptonica-1.87.0/src/quadtree.c:489:23: danger: ‘ystart’ leaks here; was allocated at [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6)
#  487|               for (j = 0; j < nside; j++) {
#  488|                   bw = xend[j] - xstart[j] + 1;
#  489|->                 box = boxCreate(xstart[j], ystart[i], bw, bh);
#  490|                   boxaAddBox(boxa, box, L_INSERT);
#  491|               }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1589]
leptonica-1.87.0/src/quadtree.c:490:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xend’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:465:23: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:490:17: throw: if ‘boxaAddBox’ throws an exception...
leptonica-1.87.0/src/quadtree.c:490:17: danger: ‘xend’ leaks here; was allocated at [(7)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/6)
#  488|                   bw = xend[j] - xstart[j] + 1;
#  489|                   box = boxCreate(xstart[j], ystart[i], bw, bh);
#  490|->                 boxaAddBox(boxa, box, L_INSERT);
#  491|               }
#  492|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1590]
leptonica-1.87.0/src/quadtree.c:490:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xstart’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:464:25: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:490:17: throw: if ‘boxaAddBox’ throws an exception...
leptonica-1.87.0/src/quadtree.c:490:17: danger: ‘xstart’ leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
#  488|                   bw = xend[j] - xstart[j] + 1;
#  489|                   box = boxCreate(xstart[j], ystart[i], bw, bh);
#  490|->                 boxaAddBox(boxa, box, L_INSERT);
#  491|               }
#  492|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1591]
leptonica-1.87.0/src/quadtree.c:490:17: warning[-Wanalyzer-malloc-leak]: leak of ‘yend’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:467:23: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:490:17: throw: if ‘boxaAddBox’ throws an exception...
leptonica-1.87.0/src/quadtree.c:490:17: danger: ‘yend’ leaks here; was allocated at [(7)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/6)
#  488|                   bw = xend[j] - xstart[j] + 1;
#  489|                   box = boxCreate(xstart[j], ystart[i], bw, bh);
#  490|->                 boxaAddBox(boxa, box, L_INSERT);
#  491|               }
#  492|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1592]
leptonica-1.87.0/src/quadtree.c:490:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ystart’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:466:25: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:490:17: throw: if ‘boxaAddBox’ throws an exception...
leptonica-1.87.0/src/quadtree.c:490:17: danger: ‘ystart’ leaks here; was allocated at [(7)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/6)
#  488|                   bw = xend[j] - xstart[j] + 1;
#  489|                   box = boxCreate(xstart[j], ystart[i], bw, bh);
#  490|->                 boxaAddBox(boxa, box, L_INSERT);
#  491|               }
#  492|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1593]
leptonica-1.87.0/src/quadtree.c:493:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xend’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:465:23: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_false: following ‘false’ branch (when ‘j >= nside’)...
leptonica-1.87.0/src/quadtree.c:485:32: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:493:9: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:493:9: throw: if ‘boxaaAddBoxa’ throws an exception...
leptonica-1.87.0/src/quadtree.c:493:9: danger: ‘xend’ leaks here; was allocated at [(7)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/6)
#  491|               }
#  492|           }
#  493|->         boxaaAddBoxa(baa, boxa, L_INSERT);
#  494|       }
#  495|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1594]
leptonica-1.87.0/src/quadtree.c:493:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xstart’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:464:25: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_false: following ‘false’ branch (when ‘j >= nside’)...
leptonica-1.87.0/src/quadtree.c:485:32: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:493:9: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:493:9: throw: if ‘boxaaAddBoxa’ throws an exception...
leptonica-1.87.0/src/quadtree.c:493:9: danger: ‘xstart’ leaks here; was allocated at [(7)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/6)
#  491|               }
#  492|           }
#  493|->         boxaaAddBoxa(baa, boxa, L_INSERT);
#  494|       }
#  495|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1595]
leptonica-1.87.0/src/quadtree.c:493:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yend’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:467:23: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_false: following ‘false’ branch (when ‘j >= nside’)...
leptonica-1.87.0/src/quadtree.c:485:32: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:493:9: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:493:9: throw: if ‘boxaaAddBoxa’ throws an exception...
leptonica-1.87.0/src/quadtree.c:493:9: danger: ‘yend’ leaks here; was allocated at [(7)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/6)
#  491|               }
#  492|           }
#  493|->         boxaaAddBoxa(baa, boxa, L_INSERT);
#  494|       }
#  495|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1596]
leptonica-1.87.0/src/quadtree.c:493:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ystart’
leptonica-1.87.0/src/quadtree.c:455:8: branch_false: following ‘false’ branch (when ‘nlevels > 0’)...
leptonica-1.87.0/src/quadtree.c:457:19: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:457:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:459:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/quadtree.c:462:11: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:466:25: acquire_memory: allocated here
leptonica-1.87.0/src/quadtree.c:468:17: branch_true: following ‘true’ branch (when ‘k < nlevels’)...
leptonica-1.87.0/src/quadtree.c:469:9: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:471:25: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:472:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:473:33: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:475:16: branch_false: following ‘false’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/quadtree.c:476:23: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:470:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:483:21: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_true: following ‘true’ branch (when ‘i < nside’)...
leptonica-1.87.0/src/quadtree.c:486:22: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_true: following ‘true’ branch (when ‘j < nside’)...
leptonica-1.87.0/src/quadtree.c:488:26: branch_true: ...to here
leptonica-1.87.0/src/quadtree.c:487:25: branch_false: following ‘false’ branch (when ‘j >= nside’)...
leptonica-1.87.0/src/quadtree.c:485:32: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:485:21: branch_false: following ‘false’ branch (when ‘i >= nside’)...
leptonica-1.87.0/src/quadtree.c:493:9: branch_false: ...to here
leptonica-1.87.0/src/quadtree.c:493:9: throw: if ‘boxaaAddBoxa’ throws an exception...
leptonica-1.87.0/src/quadtree.c:493:9: danger: ‘ystart’ leaks here; was allocated at [(7)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/6)
#  491|               }
#  492|           }
#  493|->         boxaaAddBoxa(baa, boxa, L_INSERT);
#  494|       }
#  495|   

Error: CPPCHECK_WARNING (CWE-476): [#def1597]
leptonica-1.87.0/src/queue.c:101: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lq
#   99|   
#  100|       lq = (L_QUEUE *)LEPT_CALLOC(1, sizeof(L_QUEUE));
#  101|->     if ((lq->array = (void **)LEPT_CALLOC(nalloc, sizeof(void *))) == NULL) {
#  102|           lqueueDestroy(&lq, 0);
#  103|           return (L_QUEUE *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1598]
leptonica-1.87.0/src/queue.c:101:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lq’
leptonica-1.87.0/src/queue.c:100:21: acquire_memory: this call could return NULL
leptonica-1.87.0/src/queue.c:101:9: danger: ‘calloc(1, 32)’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   99|   
#  100|       lq = (L_QUEUE *)LEPT_CALLOC(1, sizeof(L_QUEUE));
#  101|->     if ((lq->array = (void **)LEPT_CALLOC(nalloc, sizeof(void *))) == NULL) {
#  102|           lqueueDestroy(&lq, 0);
#  103|           return (L_QUEUE *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def1599]
leptonica-1.87.0/src/queue.c:105: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lq
#  103|           return (L_QUEUE *)ERROR_PTR("ptr array not made", __func__, NULL);
#  104|       }
#  105|->     lq->nalloc = nalloc;
#  106|       lq->nhead = lq->nelem = 0;
#  107|       return lq;

Error: CPPCHECK_WARNING (CWE-476): [#def1600]
leptonica-1.87.0/src/queue.c:106: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lq
#  104|       }
#  105|       lq->nalloc = nalloc;
#  106|->     lq->nhead = lq->nelem = 0;
#  107|       return lq;
#  108|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1601]
leptonica-1.87.0/src/rank.c:321:12: warning[-Wanalyzer-malloc-leak]: leak of ‘histo16’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:315:26: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:321:12: throw: if ‘pixCreateTemplate’ throws an exception...
leptonica-1.87.0/src/rank.c:321:12: danger: ‘histo16’ leaks here; was allocated at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  319|            * convenient location, because it allows us to perform
#  320|            * the rank filter over x:(0 ... w - 1) and y:(0 ... h - 1). */
#  321|->     pixd = pixCreateTemplate(pixs);
#  322|       datat = pixGetData(pixt);
#  323|       wplt = pixGetWpl(pixt);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1602]
leptonica-1.87.0/src/rank.c:321:12: warning[-Wanalyzer-malloc-leak]: leak of ‘histo’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:314:24: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:321:12: throw: if ‘pixCreateTemplate’ throws an exception...
leptonica-1.87.0/src/rank.c:321:12: danger: ‘histo’ leaks here; was allocated at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  319|            * convenient location, because it allows us to perform
#  320|            * the rank filter over x:(0 ... w - 1) and y:(0 ... h - 1). */
#  321|->     pixd = pixCreateTemplate(pixs);
#  322|       datat = pixGetData(pixt);
#  323|       wplt = pixGetWpl(pixt);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1603]
leptonica-1.87.0/src/rank.c:322:13: warning[-Wanalyzer-malloc-leak]: leak of ‘histo16’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:315:26: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:322:13: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/rank.c:322:13: danger: ‘histo16’ leaks here; was allocated at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12)
#  320|            * the rank filter over x:(0 ... w - 1) and y:(0 ... h - 1). */
#  321|       pixd = pixCreateTemplate(pixs);
#  322|->     datat = pixGetData(pixt);
#  323|       wplt = pixGetWpl(pixt);
#  324|       datad = pixGetData(pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1604]
leptonica-1.87.0/src/rank.c:322:13: warning[-Wanalyzer-malloc-leak]: leak of ‘histo’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:314:24: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:322:13: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/rank.c:322:13: danger: ‘histo’ leaks here; was allocated at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  320|            * the rank filter over x:(0 ... w - 1) and y:(0 ... h - 1). */
#  321|       pixd = pixCreateTemplate(pixs);
#  322|->     datat = pixGetData(pixt);
#  323|       wplt = pixGetWpl(pixt);
#  324|       datad = pixGetData(pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1605]
leptonica-1.87.0/src/rank.c:323:12: warning[-Wanalyzer-malloc-leak]: leak of ‘histo16’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:315:26: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:323:12: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/rank.c:323:12: danger: ‘histo16’ leaks here; was allocated at [(13)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/12)
#  321|       pixd = pixCreateTemplate(pixs);
#  322|       datat = pixGetData(pixt);
#  323|->     wplt = pixGetWpl(pixt);
#  324|       datad = pixGetData(pixd);
#  325|       wpld = pixGetWpl(pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1606]
leptonica-1.87.0/src/rank.c:323:12: warning[-Wanalyzer-malloc-leak]: leak of ‘histo’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:314:24: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:323:12: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/rank.c:323:12: danger: ‘histo’ leaks here; was allocated at [(13)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/12)
#  321|       pixd = pixCreateTemplate(pixs);
#  322|       datat = pixGetData(pixt);
#  323|->     wplt = pixGetWpl(pixt);
#  324|       datad = pixGetData(pixd);
#  325|       wpld = pixGetWpl(pixd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1607]
leptonica-1.87.0/src/rank.c:324:13: warning[-Wanalyzer-malloc-leak]: leak of ‘histo16’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:315:26: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:324:13: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/rank.c:324:13: danger: ‘histo16’ leaks here; was allocated at [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
#  322|       datat = pixGetData(pixt);
#  323|       wplt = pixGetWpl(pixt);
#  324|->     datad = pixGetData(pixd);
#  325|       wpld = pixGetWpl(pixd);
#  326|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1608]
leptonica-1.87.0/src/rank.c:324:13: warning[-Wanalyzer-malloc-leak]: leak of ‘histo’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:314:24: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:324:13: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/rank.c:324:13: danger: ‘histo’ leaks here; was allocated at [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
#  322|       datat = pixGetData(pixt);
#  323|       wplt = pixGetWpl(pixt);
#  324|->     datad = pixGetData(pixd);
#  325|       wpld = pixGetWpl(pixd);
#  326|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1609]
leptonica-1.87.0/src/rank.c:325:12: warning[-Wanalyzer-malloc-leak]: leak of ‘histo16’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:315:26: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:325:12: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/rank.c:325:12: danger: ‘histo16’ leaks here; was allocated at [(13)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/12)
#  323|       wplt = pixGetWpl(pixt);
#  324|       datad = pixGetData(pixd);
#  325|->     wpld = pixGetWpl(pixd);
#  326|   
#  327|           /* If hf > wf, it's more efficient to use row-major scanning.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1610]
leptonica-1.87.0/src/rank.c:325:12: warning[-Wanalyzer-malloc-leak]: leak of ‘histo’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:314:24: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:325:12: throw: if ‘pixGetWpl’ throws an exception...
leptonica-1.87.0/src/rank.c:325:12: danger: ‘histo’ leaks here; was allocated at [(13)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/12)
#  323|       wplt = pixGetWpl(pixt);
#  324|       datad = pixGetData(pixd);
#  325|->     wpld = pixGetWpl(pixd);
#  326|   
#  327|           /* If hf > wf, it's more efficient to use row-major scanning.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1611]
leptonica-1.87.0/src/rank.c:333:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘histo’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:314:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/rank.c:329:8: branch_true: following ‘true’ branch (when ‘wf < hf’)...
leptonica-1.87.0/src/rank.c:329:8: branch_true: ...to here
leptonica-1.87.0/src/rank.c:330:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rank.c:330:21: branch_true: ...to here
leptonica-1.87.0/src/rank.c:332:25: branch_true: following ‘true’ branch (when ‘n != 256’)...
leptonica-1.87.0/src/rank.c:333:22: branch_true: ...to here
leptonica-1.87.0/src/rank.c:333:17: danger: ‘histo + (long unsigned int)n * 4’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/12)
#  331|                   /* Start each column with clean histogram arrays. */
#  332|               for (n = 0; n < 256; n++)
#  333|->                 histo[n] = 0;
#  334|               for (n = 0; n < 16; n++)
#  335|                   histo16[n] = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1612]
leptonica-1.87.0/src/rank.c:393:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘histo’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:314:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/rank.c:329:8: branch_false: following ‘false’ branch (when ‘wf >= hf’)...
leptonica-1.87.0/src/rank.c:329:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:390:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rank.c:390:21: branch_true: ...to here
leptonica-1.87.0/src/rank.c:392:25: branch_true: following ‘true’ branch (when ‘n != 256’)...
leptonica-1.87.0/src/rank.c:393:22: branch_true: ...to here
leptonica-1.87.0/src/rank.c:393:17: danger: ‘histo + (long unsigned int)n * 4’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/12)
#  391|                   /* Start each row with clean histogram arrays. */
#  392|               for (n = 0; n < 256; n++)
#  393|->                 histo[n] = 0;
#  394|               for (n = 0; n < 16; n++)
#  395|                   histo16[n] = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1613]
leptonica-1.87.0/src/rank.c:447:5: warning[-Wanalyzer-malloc-leak]: leak of ‘histo16’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:315:26: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:390:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:447:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:447:5: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/rank.c:447:5: danger: ‘histo16’ leaks here; was allocated at [(13)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/12)
#  445|       }
#  446|   
#  447|->     pixDestroy(&pixt);
#  448|       LEPT_FREE(histo);
#  449|       LEPT_FREE(histo16);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1614]
leptonica-1.87.0/src/rank.c:447:5: warning[-Wanalyzer-malloc-leak]: leak of ‘histo’
leptonica-1.87.0/src/rank.c:279:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:281:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:282:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:284:9: branch_false: ...to here
leptonica-1.87.0/src/rank.c:284:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:286:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:286:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:288:8: branch_false: ...to here
leptonica-1.87.0/src/rank.c:309:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:314:24: branch_false: ...to here
leptonica-1.87.0/src/rank.c:314:24: acquire_memory: allocated here
leptonica-1.87.0/src/rank.c:390:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rank.c:447:5: branch_false: ...to here
leptonica-1.87.0/src/rank.c:447:5: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/rank.c:447:5: danger: ‘histo’ leaks here; was allocated at [(13)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/12)
#  445|       }
#  446|   
#  447|->     pixDestroy(&pixt);
#  448|       LEPT_FREE(histo);
#  449|       LEPT_FREE(histo16);

Error: CPPCHECK_WARNING (CWE-476): [#def1615]
leptonica-1.87.0/src/rbtree.c:144: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: t
#  142|   
#  143|       t = (L_RBTREE *)LEPT_CALLOC(1, sizeof(L_RBTREE));
#  144|->     t->keytype = keytype;
#  145|       verify_properties(t);
#  146|       return t;

Error: CPPCHECK_WARNING (CWE-476): [#def1616]
leptonica-1.87.0/src/rbtree.c:609: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  607|                         node *left, node *right) {
#  608|       node *result = (node *)LEPT_CALLOC(1, sizeof(node));
#  609|->     result->key = key;
#  610|       result->value = value;
#  611|       result->color = node_color;

Error: CPPCHECK_WARNING (CWE-476): [#def1617]
leptonica-1.87.0/src/rbtree.c:610: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  608|       node *result = (node *)LEPT_CALLOC(1, sizeof(node));
#  609|       result->key = key;
#  610|->     result->value = value;
#  611|       result->color = node_color;
#  612|       result->left = left;

Error: CPPCHECK_WARNING (CWE-476): [#def1618]
leptonica-1.87.0/src/rbtree.c:611: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  609|       result->key = key;
#  610|       result->value = value;
#  611|->     result->color = node_color;
#  612|       result->left = left;
#  613|       result->right = right;

Error: CPPCHECK_WARNING (CWE-476): [#def1619]
leptonica-1.87.0/src/rbtree.c:612: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  610|       result->value = value;
#  611|       result->color = node_color;
#  612|->     result->left = left;
#  613|       result->right = right;
#  614|       if (left != NULL) left->parent = result;

Error: CPPCHECK_WARNING (CWE-476): [#def1620]
leptonica-1.87.0/src/rbtree.c:613: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  611|       result->color = node_color;
#  612|       result->left = left;
#  613|->     result->right = right;
#  614|       if (left != NULL) left->parent = result;
#  615|       if (right != NULL) right->parent = result;

Error: CPPCHECK_WARNING (CWE-476): [#def1621]
leptonica-1.87.0/src/rbtree.c:616: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  614|       if (left != NULL) left->parent = result;
#  615|       if (right != NULL) right->parent = result;
#  616|->     result->parent = NULL;
#  617|       return result;
#  618|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1622]
leptonica-1.87.0/src/rbtree.c:636:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘n’
leptonica-1.87.0/src/rbtree.c:773:13: enter_function: entry to ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:781:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rbtree.c:782:16: branch_true: ...to here
leptonica-1.87.0/src/rbtree.c:782:16: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:782:16: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:783:27: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:783:27: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:783:16: call_function: inlined call to ‘node_color’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:781:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rbtree.c:784:27: branch_true: ...to here
leptonica-1.87.0/src/rbtree.c:784:27: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:784:27: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:785:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:785:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:786:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:786:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:787:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:787:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:787:9: call_function: calling ‘rotate_left’ from ‘delete_case5’
#  634|   
#  635|   static void rotate_left(L_RBTREE *t, node *n) {
#  636|->     node *r = n->right;
#  637|       replace_node(t, n, r);
#  638|       n->right = r->left;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1623]
leptonica-1.87.0/src/rbtree.c:647:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘n’
leptonica-1.87.0/src/rbtree.c:773:13: enter_function: entry to ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:774:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rbtree.c:775:9: branch_true: ...to here
leptonica-1.87.0/src/rbtree.c:775:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:775:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:776:20: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:776:20: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:776:9: call_function: inlined call to ‘node_color’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:774:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rbtree.c:777:20: branch_true: ...to here
leptonica-1.87.0/src/rbtree.c:777:20: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:777:20: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:778:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:778:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:779:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:779:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:780:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:780:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:780:9: call_function: calling ‘rotate_right’ from ‘delete_case5’
#  645|   
#  646|   static void rotate_right(L_RBTREE *t, node *n) {
#  647|->     node *L = n->left;
#  648|       replace_node(t, n, L);
#  649|       n->left = L->right;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1624]
leptonica-1.87.0/src/rbtree.c:752:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.87.0/src/rbtree.c:749:13: enter_function: entry to ‘delete_case3’
leptonica-1.87.0/src/rbtree.c:751:9: call_function: calling ‘sibling’ from ‘delete_case3’
leptonica-1.87.0/src/rbtree.c:751:9: return_function: returning to ‘delete_case3’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:751:9: call_function: inlined call to ‘node_color’ from ‘delete_case3’
leptonica-1.87.0/src/rbtree.c:752:20: branch_false: ...to here
leptonica-1.87.0/src/rbtree.c:752:20: call_function: calling ‘sibling’ from ‘delete_case3’
leptonica-1.87.0/src/rbtree.c:752:20: return_function: returning to ‘delete_case3’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:752:20: danger: dereference of NULL ‘sibling(n)’
#  750|       if (node_color(n->parent) == L_BLACK_NODE &&
#  751|           node_color(sibling(n)) == L_BLACK_NODE &&
#  752|->         node_color(sibling(n)->left) == L_BLACK_NODE &&
#  753|           node_color(sibling(n)->right) == L_BLACK_NODE) {
#  754|           sibling(n)->color = L_RED_NODE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1625]
leptonica-1.87.0/src/rbtree.c:779:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.87.0/src/rbtree.c:773:13: enter_function: entry to ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:774:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rbtree.c:775:9: branch_true: ...to here
leptonica-1.87.0/src/rbtree.c:775:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:775:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:776:20: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:776:20: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:776:9: call_function: inlined call to ‘node_color’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:774:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rbtree.c:777:20: branch_true: ...to here
leptonica-1.87.0/src/rbtree.c:777:20: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:777:20: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:778:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:778:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:779:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:779:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:779:9: danger: dereference of NULL ‘sibling(n)’
#  777|           node_color(sibling(n)->right) == L_BLACK_NODE) {
#  778|           sibling(n)->color = L_RED_NODE;
#  779|->         sibling(n)->left->color = L_BLACK_NODE;
#  780|           rotate_right(t, sibling(n));
#  781|       } else if (n == n->parent->right &&

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1626]
leptonica-1.87.0/src/rbtree.c:786:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.87.0/src/rbtree.c:773:13: enter_function: entry to ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:781:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rbtree.c:782:16: branch_true: ...to here
leptonica-1.87.0/src/rbtree.c:782:16: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:782:16: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:783:27: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:783:27: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:783:16: call_function: inlined call to ‘node_color’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:781:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rbtree.c:784:27: branch_true: ...to here
leptonica-1.87.0/src/rbtree.c:784:27: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:784:27: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:785:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:785:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:786:9: call_function: calling ‘sibling’ from ‘delete_case5’
leptonica-1.87.0/src/rbtree.c:786:9: return_function: returning to ‘delete_case5’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:786:9: danger: dereference of NULL ‘sibling(n)’
#  784|                  node_color(sibling(n)->left) == L_BLACK_NODE) {
#  785|           sibling(n)->color = L_RED_NODE;
#  786|->         sibling(n)->right->color = L_BLACK_NODE;
#  787|           rotate_left(t, sibling(n));
#  788|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1627]
leptonica-1.87.0/src/rbtree.c:793:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.87.0/src/rbtree.c:792:13: enter_function: entry to ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:793:5: call_function: calling ‘sibling’ from ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:793:5: return_function: returning to ‘delete_case6’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:793:25: call_function: inlined call to ‘node_color’ from ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:793:5: branch_false: ...to here
leptonica-1.87.0/src/rbtree.c:793:5: danger: dereference of NULL ‘sibling(n)’
#  791|   
#  792|   static void delete_case6(L_RBTREE *t, node *n) {
#  793|->     sibling(n)->color = node_color(n->parent);
#  794|       n->parent->color = L_BLACK_NODE;
#  795|       if (n == n->parent->left) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1628]
leptonica-1.87.0/src/rbtree.c:796:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.87.0/src/rbtree.c:792:13: enter_function: entry to ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:793:5: call_function: calling ‘sibling’ from ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:793:5: return_function: returning to ‘delete_case6’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:793:25: call_function: inlined call to ‘node_color’ from ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:795:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rbtree.c:796:24: branch_true: ...to here
leptonica-1.87.0/src/rbtree.c:796:24: call_function: calling ‘sibling’ from ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:796:24: return_function: returning to ‘delete_case6’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:796:24: danger: dereference of NULL ‘sibling(n)’
#  794|       n->parent->color = L_BLACK_NODE;
#  795|       if (n == n->parent->left) {
#  796|->         if (node_color(sibling(n)->right) != L_RED_NODE) {
#  797|               L_ERROR("right sibling is not RED", "delete_case6");
#  798|               return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1629]
leptonica-1.87.0/src/rbtree.c:803:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
leptonica-1.87.0/src/rbtree.c:792:13: enter_function: entry to ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:793:5: call_function: calling ‘sibling’ from ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:793:5: return_function: returning to ‘delete_case6’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:793:25: call_function: inlined call to ‘node_color’ from ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:795:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rbtree.c:803:24: branch_false: ...to here
leptonica-1.87.0/src/rbtree.c:803:24: call_function: calling ‘sibling’ from ‘delete_case6’
leptonica-1.87.0/src/rbtree.c:803:24: return_function: returning to ‘delete_case6’ from ‘sibling’
leptonica-1.87.0/src/rbtree.c:803:24: danger: dereference of NULL ‘sibling(n)’
#  801|           rotate_left(t, n->parent);
#  802|       } else {
#  803|->         if (node_color(sibling(n)->left) != L_RED_NODE) {
#  804|               L_ERROR("left sibling is not RED", "delete_case6");
#  805|               return;

Error: CPPCHECK_WARNING (CWE-476): [#def1630]
leptonica-1.87.0/src/readbarcode.c:302: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: barstr
#  300|           for (j = 0; j < nbars; j++) {
#  301|               numaGetIValue(na, j, &ival);
#  302|->             barstr[j] = 0x30 + ival;
#  303|           }
#  304|           sarrayAddString(saw, barstr, L_INSERT);

Error: COMPILER_WARNING (CWE-563): [#def1631]
leptonica-1.87.0/src/readbarcode.h:78:21: warning[-Wunused-variable]: ‘SupportedBarcodeFormatName’ defined but not used
#   78 | static const char  *SupportedBarcodeFormatName[] = {
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
#   76|   
#   77|   /*! Currently supported format names */
#   78|-> static const char  *SupportedBarcodeFormatName[] = {
#   79|       "Code2of5",
#   80|       "CodeI2of5",

Error: COMPILER_WARNING (CWE-563): [#def1632]
leptonica-1.87.0/src/readbarcode.h:93:20: warning[-Wunused-variable]: ‘Code2of5’ defined but not used
#   93 | static const char *Code2of5[] = {
#      |                    ^~~~~~~~
#   91|        *                       Code 2 of 5 symbology                       *
#   92|        * ----------------------------------------------------------------- */
#   93|-> static const char *Code2of5[] = {
#   94|       "111121211", "211111112", "112111112", "212111111",   /* 0 - 3 */
#   95|       "111121112", "211121111", "112121111", "111111212",   /* 4 - 7 */

Error: COMPILER_WARNING (CWE-563): [#def1633]
leptonica-1.87.0/src/readbarcode.h:107:20: warning[-Wunused-variable]: ‘CodeI2of5’ defined but not used
#  107 | static const char *CodeI2of5[] = {
#      |                    ^~~~~~~~~
#  105|        *                Code Interleaved 2 of 5 symbology                  *
#  106|        * ----------------------------------------------------------------- */
#  107|-> static const char *CodeI2of5[] = {
#  108|       "11221", "21112", "12112", "22111", "11212",    /*  0 - 4 */
#  109|       "21211", "12211", "11122", "21121", "12121",    /*  5 - 9 */

Error: COMPILER_WARNING (CWE-563): [#def1634]
leptonica-1.87.0/src/readbarcode.h:120:20: warning[-Wunused-variable]: ‘Code93’ defined but not used
#  120 | static const char *Code93[] = {
#      |                    ^~~~~~
#  118|        *                         Code 93 symbology                         *
#  119|        * ----------------------------------------------------------------- */
#  120|-> static const char *Code93[] = {
#  121|       "131112", "111213", "111312", "111411", "121113", /* 0: 0 - 4 */
#  122|       "121212", "121311", "111114", "131211", "141111", /* 5: 5 - 9 */

Error: COMPILER_WARNING (CWE-563): [#def1635]
leptonica-1.87.0/src/readbarcode.h:144:20: warning[-Wunused-variable]: ‘Code39’ defined but not used
#  144 | static const char *Code39[] = {
#      |                    ^~~~~~
#  142|        *                         Code 39 symbology                         *
#  143|        * ----------------------------------------------------------------- */
#  144|-> static const char *Code39[] = {
#  145|       "111221211", "211211112", "112211112", "212211111",  /* 0: 0 - 3      */
#  146|       "111221112", "211221111", "112221111", "111211212",  /* 4: 4 - 7      */

Error: COMPILER_WARNING (CWE-563): [#def1636]
leptonica-1.87.0/src/readbarcode.h:169:20: warning[-Wunused-variable]: ‘Codabar’ defined but not used
#  169 | static const char *Codabar[] = {
#      |                    ^~~~~~~
#  167|        *                         Codabar symbology                         *
#  168|        * ----------------------------------------------------------------- */
#  169|-> static const char *Codabar[] = {
#  170|       "1111122", "1111221", "1112112", "2211111", "1121121", /* 0: 0 - 4      */
#  171|       "2111121", "1211112", "1211211", "1221111", "2112111", /* 5: 5 - 9      */

Error: COMPILER_WARNING (CWE-563): [#def1637]
leptonica-1.87.0/src/readbarcode.h:184:20: warning[-Wunused-variable]: ‘Upca’ defined but not used
#  184 | static const char *Upca[] = {
#      |                    ^~~~
#  182|        *                          UPC-A symbology                          *
#  183|        * ----------------------------------------------------------------- */
#  184|-> static const char *Upca[] = {
#  185|       "3211", "2221", "2122", "1411", "1132",  /* 0: 0 - 4              */
#  186|       "1231", "1114", "1312", "1213", "3112",  /* 5: 5 - 9              */

Error: COMPILER_WARNING (CWE-563): [#def1638]
leptonica-1.87.0/src/bardecode.c:68: included_from: Included from here.
leptonica-1.87.0/src/readbarcode.h:198:20: warning[-Wunused-variable]: ‘Code128’ defined but not used
#  198 | static const char *Code128[] = {
#      |                    ^~~~~~~
#  196|        *                         Code128 symbology                         *
#  197|        * ----------------------------------------------------------------- */
#  198|-> static const char *Code128[] = {
#  199|       "212222", "222122", "222221", "121223", "121322",    /*  0 - 4 */
#  200|       "131222", "122213", "122312", "132212", "221213",    /*  5 - 9 */

Error: COMPILER_WARNING (CWE-563): [#def1639]
leptonica-1.87.0/src/readfile.c:96:20: warning[-Wunused-variable]: ‘FILE_JP2K’ defined but not used
#   96 | static const char *FILE_JP2K =  "/tmp/lept/format/file.jp2";
#      |                    ^~~~~~~~~
#   94|   static const char *FILE_GIF  =  "/tmp/lept/format/file.gif";
#   95|   static const char *FILE_WEBP =  "/tmp/lept/format/file.webp";
#   96|-> static const char *FILE_JP2K =  "/tmp/lept/format/file.jp2";
#   97|   
#   98|       /* There are two jp2 formats, and two codecs associated with them:

Error: CPPCHECK_WARNING (CWE-457): [#def1640]
leptonica-1.87.0/src/readfile.c:671: error[uninitvar]: Uninitialized variable: twobytepw
#  669|       ((char *)(&twobytepw))[1] = buf[1];
#  670|   
#  671|->     if (convertOnBigEnd16(twobytepw) == BMP_ID) {
#  672|           *pformat = IFF_BMP;
#  673|           return 0;

Error: CPPCHECK_WARNING (CWE-476): [#def1641]
leptonica-1.87.0/src/recogbasic.c:433: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  431|   
#  432|       recog = (L_RECOG *)LEPT_CALLOC(1, sizeof(L_RECOG));
#  433|->     recog->templ_use = L_USE_ALL_TEMPLATES;  /* default */
#  434|       recog->threshold = threshold;
#  435|       recog->scalew = scalew;

Error: CPPCHECK_WARNING (CWE-476): [#def1642]
leptonica-1.87.0/src/recogbasic.c:434: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  432|       recog = (L_RECOG *)LEPT_CALLOC(1, sizeof(L_RECOG));
#  433|       recog->templ_use = L_USE_ALL_TEMPLATES;  /* default */
#  434|->     recog->threshold = threshold;
#  435|       recog->scalew = scalew;
#  436|       recog->scaleh = scaleh;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1643]
leptonica-1.87.0/src/recogbasic.c:434:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘recog’
leptonica-1.87.0/src/recogbasic.c:415:8: branch_false: following ‘false’ branch (when ‘linew <= 10’)...
leptonica-1.87.0/src/recogbasic.c:417:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:432:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/recogbasic.c:434:5: danger: ‘recog’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  432|       recog = (L_RECOG *)LEPT_CALLOC(1, sizeof(L_RECOG));
#  433|       recog->templ_use = L_USE_ALL_TEMPLATES;  /* default */
#  434|->     recog->threshold = threshold;
#  435|       recog->scalew = scalew;
#  436|       recog->scaleh = scaleh;

Error: CPPCHECK_WARNING (CWE-476): [#def1644]
leptonica-1.87.0/src/recogbasic.c:435: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  433|       recog->templ_use = L_USE_ALL_TEMPLATES;  /* default */
#  434|       recog->threshold = threshold;
#  435|->     recog->scalew = scalew;
#  436|       recog->scaleh = scaleh;
#  437|       recog->linew = linew;

Error: CPPCHECK_WARNING (CWE-476): [#def1645]
leptonica-1.87.0/src/recogbasic.c:436: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  434|       recog->threshold = threshold;
#  435|       recog->scalew = scalew;
#  436|->     recog->scaleh = scaleh;
#  437|       recog->linew = linew;
#  438|       recog->maxyshift = maxyshift;

Error: CPPCHECK_WARNING (CWE-476): [#def1646]
leptonica-1.87.0/src/recogbasic.c:437: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  435|       recog->scalew = scalew;
#  436|       recog->scaleh = scaleh;
#  437|->     recog->linew = linew;
#  438|       recog->maxyshift = maxyshift;
#  439|       recogSetParams(recog, 1, -1, -1.0, -1.0);

Error: CPPCHECK_WARNING (CWE-476): [#def1647]
leptonica-1.87.0/src/recogbasic.c:438: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  436|       recog->scaleh = scaleh;
#  437|       recog->linew = linew;
#  438|->     recog->maxyshift = maxyshift;
#  439|       recogSetParams(recog, 1, -1, -1.0, -1.0);
#  440|       recog->bmf = bmfCreate(NULL, 6);

Error: CPPCHECK_WARNING (CWE-476): [#def1648]
leptonica-1.87.0/src/recogbasic.c:440: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  438|       recog->maxyshift = maxyshift;
#  439|       recogSetParams(recog, 1, -1, -1.0, -1.0);
#  440|->     recog->bmf = bmfCreate(NULL, 6);
#  441|       recog->bmf_size = 6;
#  442|       recog->maxarraysize = MaxExamplesInClass;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1649]
leptonica-1.87.0/src/recogbasic.c:440:18: warning[-Wanalyzer-malloc-leak]: leak of ‘recog’
leptonica-1.87.0/src/recogbasic.c:405:1: enter_function: entry to ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:415:8: branch_false: following ‘false’ branch (when ‘linew <= 10’)...
leptonica-1.87.0/src/recogbasic.c:417:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:432:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogbasic.c:439:5: call_function: calling ‘recogSetParams’ from ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:439:5: return_function: returning to ‘recogCreate’ from ‘recogSetParams’
leptonica-1.87.0/src/recogbasic.c:440:18: throw: if ‘bmfCreate’ throws an exception...
leptonica-1.87.0/src/recogbasic.c:440:18: danger: ‘recog’ leaks here; was allocated at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
#  438|       recog->maxyshift = maxyshift;
#  439|       recogSetParams(recog, 1, -1, -1.0, -1.0);
#  440|->     recog->bmf = bmfCreate(NULL, 6);
#  441|       recog->bmf_size = 6;
#  442|       recog->maxarraysize = MaxExamplesInClass;

Error: CPPCHECK_WARNING (CWE-476): [#def1650]
leptonica-1.87.0/src/recogbasic.c:441: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  439|       recogSetParams(recog, 1, -1, -1.0, -1.0);
#  440|       recog->bmf = bmfCreate(NULL, 6);
#  441|->     recog->bmf_size = 6;
#  442|       recog->maxarraysize = MaxExamplesInClass;
#  443|   

Error: CPPCHECK_WARNING (CWE-476): [#def1651]
leptonica-1.87.0/src/recogbasic.c:442: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  440|       recog->bmf = bmfCreate(NULL, 6);
#  441|       recog->bmf_size = 6;
#  442|->     recog->maxarraysize = MaxExamplesInClass;
#  443|   
#  444|           /* Generate the LUTs */

Error: CPPCHECK_WARNING (CWE-476): [#def1652]
leptonica-1.87.0/src/recogbasic.c:445: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  443|   
#  444|           /* Generate the LUTs */
#  445|->     recog->centtab = makePixelCentroidTab8();
#  446|       recog->sumtab = makePixelSumTab8();
#  447|       recog->sa_text = sarrayCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1653]
leptonica-1.87.0/src/recogbasic.c:445:22: warning[-Wanalyzer-malloc-leak]: leak of ‘recog’
leptonica-1.87.0/src/recogbasic.c:405:1: enter_function: entry to ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:415:8: branch_false: following ‘false’ branch (when ‘linew <= 10’)...
leptonica-1.87.0/src/recogbasic.c:417:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:432:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogbasic.c:439:5: call_function: calling ‘recogSetParams’ from ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:439:5: return_function: returning to ‘recogCreate’ from ‘recogSetParams’
leptonica-1.87.0/src/recogbasic.c:445:22: throw: if ‘makePixelCentroidTab8’ throws an exception...
leptonica-1.87.0/src/recogbasic.c:445:22: danger: ‘recog’ leaks here; was allocated at [(4)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/3)
#  443|   
#  444|           /* Generate the LUTs */
#  445|->     recog->centtab = makePixelCentroidTab8();
#  446|       recog->sumtab = makePixelSumTab8();
#  447|       recog->sa_text = sarrayCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def1654]
leptonica-1.87.0/src/recogbasic.c:446: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  444|           /* Generate the LUTs */
#  445|       recog->centtab = makePixelCentroidTab8();
#  446|->     recog->sumtab = makePixelSumTab8();
#  447|       recog->sa_text = sarrayCreate(0);
#  448|       recog->dna_tochar = l_dnaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1655]
leptonica-1.87.0/src/recogbasic.c:446:21: warning[-Wanalyzer-malloc-leak]: leak of ‘recog’
leptonica-1.87.0/src/recogbasic.c:405:1: enter_function: entry to ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:415:8: branch_false: following ‘false’ branch (when ‘linew <= 10’)...
leptonica-1.87.0/src/recogbasic.c:417:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:432:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogbasic.c:439:5: call_function: calling ‘recogSetParams’ from ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:439:5: return_function: returning to ‘recogCreate’ from ‘recogSetParams’
leptonica-1.87.0/src/recogbasic.c:446:21: throw: if ‘makePixelSumTab8’ throws an exception...
leptonica-1.87.0/src/recogbasic.c:446:21: danger: ‘recog’ leaks here; was allocated at [(4)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/3)
#  444|           /* Generate the LUTs */
#  445|       recog->centtab = makePixelCentroidTab8();
#  446|->     recog->sumtab = makePixelSumTab8();
#  447|       recog->sa_text = sarrayCreate(0);
#  448|       recog->dna_tochar = l_dnaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def1656]
leptonica-1.87.0/src/recogbasic.c:447: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  445|       recog->centtab = makePixelCentroidTab8();
#  446|       recog->sumtab = makePixelSumTab8();
#  447|->     recog->sa_text = sarrayCreate(0);
#  448|       recog->dna_tochar = l_dnaCreate(0);
#  449|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1657]
leptonica-1.87.0/src/recogbasic.c:447:22: warning[-Wanalyzer-malloc-leak]: leak of ‘recog’
leptonica-1.87.0/src/recogbasic.c:405:1: enter_function: entry to ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:415:8: branch_false: following ‘false’ branch (when ‘linew <= 10’)...
leptonica-1.87.0/src/recogbasic.c:417:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:432:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogbasic.c:439:5: call_function: calling ‘recogSetParams’ from ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:439:5: return_function: returning to ‘recogCreate’ from ‘recogSetParams’
leptonica-1.87.0/src/recogbasic.c:447:22: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/recogbasic.c:447:22: danger: ‘recog’ leaks here; was allocated at [(4)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/3)
#  445|       recog->centtab = makePixelCentroidTab8();
#  446|       recog->sumtab = makePixelSumTab8();
#  447|->     recog->sa_text = sarrayCreate(0);
#  448|       recog->dna_tochar = l_dnaCreate(0);
#  449|   

Error: CPPCHECK_WARNING (CWE-476): [#def1658]
leptonica-1.87.0/src/recogbasic.c:448: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  446|       recog->sumtab = makePixelSumTab8();
#  447|       recog->sa_text = sarrayCreate(0);
#  448|->     recog->dna_tochar = l_dnaCreate(0);
#  449|   
#  450|           /* Input default values for min component size for splitting.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1659]
leptonica-1.87.0/src/recogbasic.c:448:25: warning[-Wanalyzer-malloc-leak]: leak of ‘recog’
leptonica-1.87.0/src/recogbasic.c:405:1: enter_function: entry to ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:415:8: branch_false: following ‘false’ branch (when ‘linew <= 10’)...
leptonica-1.87.0/src/recogbasic.c:417:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:432:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogbasic.c:439:5: call_function: calling ‘recogSetParams’ from ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:439:5: return_function: returning to ‘recogCreate’ from ‘recogSetParams’
leptonica-1.87.0/src/recogbasic.c:448:25: throw: if ‘l_dnaCreate’ throws an exception...
leptonica-1.87.0/src/recogbasic.c:448:25: danger: ‘recog’ leaks here; was allocated at [(4)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/3)
#  446|       recog->sumtab = makePixelSumTab8();
#  447|       recog->sa_text = sarrayCreate(0);
#  448|->     recog->dna_tochar = l_dnaCreate(0);
#  449|   
#  450|           /* Input default values for min component size for splitting.

Error: CPPCHECK_WARNING (CWE-476): [#def1660]
leptonica-1.87.0/src/recogbasic.c:452: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  450|           /* Input default values for min component size for splitting.
#  451|            * These are overwritten when pixTrainingFinished() is called. */
#  452|->     recog->min_splitw = 6;
#  453|       recog->max_splith = 60;
#  454|   

Error: CPPCHECK_WARNING (CWE-476): [#def1661]
leptonica-1.87.0/src/recogbasic.c:453: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  451|            * These are overwritten when pixTrainingFinished() is called. */
#  452|       recog->min_splitw = 6;
#  453|->     recog->max_splith = 60;
#  454|   
#  455|           /* Allocate the paa for the unscaled training bitmaps */

Error: CPPCHECK_WARNING (CWE-476): [#def1662]
leptonica-1.87.0/src/recogbasic.c:456: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  454|   
#  455|           /* Allocate the paa for the unscaled training bitmaps */
#  456|->     recog->pixaa_u = pixaaCreate(recog->maxarraysize);
#  457|   
#  458|           /* Generate the storage for debugging */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1663]
leptonica-1.87.0/src/recogbasic.c:456:22: warning[-Wanalyzer-malloc-leak]: leak of ‘recog’
leptonica-1.87.0/src/recogbasic.c:405:1: enter_function: entry to ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:415:8: branch_false: following ‘false’ branch (when ‘linew <= 10’)...
leptonica-1.87.0/src/recogbasic.c:417:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:432:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogbasic.c:439:5: call_function: calling ‘recogSetParams’ from ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:439:5: return_function: returning to ‘recogCreate’ from ‘recogSetParams’
leptonica-1.87.0/src/recogbasic.c:456:22: throw: if ‘pixaaCreate’ throws an exception...
leptonica-1.87.0/src/recogbasic.c:456:22: danger: ‘recog’ leaks here; was allocated at [(4)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/3)
#  454|   
#  455|           /* Allocate the paa for the unscaled training bitmaps */
#  456|->     recog->pixaa_u = pixaaCreate(recog->maxarraysize);
#  457|   
#  458|           /* Generate the storage for debugging */

Error: CPPCHECK_WARNING (CWE-476): [#def1664]
leptonica-1.87.0/src/recogbasic.c:459: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  457|   
#  458|           /* Generate the storage for debugging */
#  459|->     recog->pixadb_boot = pixaCreate(2);
#  460|       recog->pixadb_split = pixaCreate(2);
#  461|       return recog;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1665]
leptonica-1.87.0/src/recogbasic.c:459:26: warning[-Wanalyzer-malloc-leak]: leak of ‘recog’
leptonica-1.87.0/src/recogbasic.c:405:1: enter_function: entry to ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:415:8: branch_false: following ‘false’ branch (when ‘linew <= 10’)...
leptonica-1.87.0/src/recogbasic.c:417:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:432:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogbasic.c:439:5: call_function: calling ‘recogSetParams’ from ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:439:5: return_function: returning to ‘recogCreate’ from ‘recogSetParams’
leptonica-1.87.0/src/recogbasic.c:459:26: throw: if ‘pixaCreate’ throws an exception...
leptonica-1.87.0/src/recogbasic.c:459:26: danger: ‘recog’ leaks here; was allocated at [(4)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/3)
#  457|   
#  458|           /* Generate the storage for debugging */
#  459|->     recog->pixadb_boot = pixaCreate(2);
#  460|       recog->pixadb_split = pixaCreate(2);
#  461|       return recog;

Error: CPPCHECK_WARNING (CWE-476): [#def1666]
leptonica-1.87.0/src/recogbasic.c:460: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: recog
#  458|           /* Generate the storage for debugging */
#  459|       recog->pixadb_boot = pixaCreate(2);
#  460|->     recog->pixadb_split = pixaCreate(2);
#  461|       return recog;
#  462|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1667]
leptonica-1.87.0/src/recogbasic.c:460:27: warning[-Wanalyzer-malloc-leak]: leak of ‘recog’
leptonica-1.87.0/src/recogbasic.c:405:1: enter_function: entry to ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:415:8: branch_false: following ‘false’ branch (when ‘linew <= 10’)...
leptonica-1.87.0/src/recogbasic.c:417:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:432:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogbasic.c:439:5: call_function: calling ‘recogSetParams’ from ‘recogCreate’
leptonica-1.87.0/src/recogbasic.c:439:5: return_function: returning to ‘recogCreate’ from ‘recogSetParams’
leptonica-1.87.0/src/recogbasic.c:460:27: throw: if ‘pixaCreate’ throws an exception...
leptonica-1.87.0/src/recogbasic.c:460:27: danger: ‘recog’ leaks here; was allocated at [(4)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/3)
#  458|           /* Generate the storage for debugging */
#  459|       recog->pixadb_boot = pixaCreate(2);
#  460|->     recog->pixadb_split = pixaCreate(2);
#  461|       return recog;
#  462|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1668]
leptonica-1.87.0/src/recogbasic.c:1011:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
leptonica-1.87.0/src/recogbasic.c:1034:1: enter_function: entry to ‘recogWriteMem’
leptonica-1.87.0/src/recogbasic.c:1042:8: branch_true: following ‘true’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/recogbasic.c:1042:16: branch_true: ...to here
leptonica-1.87.0/src/recogbasic.c:1043:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/recogbasic.c:1045:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:1045:8: branch_false: following ‘false’ branch (when ‘psize’ is non-NULL)...
leptonica-1.87.0/src/recogbasic.c:1047:8: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:1047:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogbasic.c:1051:15: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:1051:15: acquire_memory: allocated here
leptonica-1.87.0/src/recogbasic.c:1051:8: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
leptonica-1.87.0/src/recogbasic.c:1053:11: branch_false: ...to here
leptonica-1.87.0/src/recogbasic.c:1053:11: call_function: calling ‘recogWriteStream’ from ‘recogWriteMem’
# 1009|       fprintf(fp, "Normalized line width = %d\n", recog->linew);
# 1010|       fprintf(fp, "\nLabels for character set:\n");
# 1011|->     l_dnaWriteStream(fp, recog->dna_tochar);
# 1012|       sarrayWriteStream(fp, recog->sa_text);
# 1013|       fprintf(fp, "\nPixaa of all samples in the training set:\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1669]
leptonica-1.87.0/src/recogdid.c:395:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: allocated here
leptonica-1.87.0/src/recogdid.c:395:16: throw: if ‘numaGetIArray’ throws an exception...
leptonica-1.87.0/src/recogdid.c:395:16: danger: ‘ycent1’ leaks here; was allocated at [(17)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/16)
#  393|       nx = w1 - w2 + 1;  /* number of positions w2 can be placed in w1 */
#  394|       ycent1 = (l_int32 *)LEPT_CALLOC(nx, sizeof(l_int32));
#  395|->     arraysum = numaGetIArray(nasum);
#  396|       arraymoment = numaGetIArray(namoment);
#  397|       for (i = 0, sum = 0, moment = 0; i < w2; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1670]
leptonica-1.87.0/src/recogdid.c:396:19: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: allocated here
leptonica-1.87.0/src/recogdid.c:396:19: throw: if ‘numaGetIArray’ throws an exception...
leptonica-1.87.0/src/recogdid.c:396:19: danger: ‘ycent1’ leaks here; was allocated at [(17)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/16)
#  394|       ycent1 = (l_int32 *)LEPT_CALLOC(nx, sizeof(l_int32));
#  395|       arraysum = numaGetIArray(nasum);
#  396|->     arraymoment = numaGetIArray(namoment);
#  397|       for (i = 0, sum = 0, moment = 0; i < w2; i++) {
#  398|           sum += arraysum[i];

Error: CPPCHECK_WARNING (CWE-476): [#def1671]
leptonica-1.87.0/src/recogdid.c:402: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ycent1
#  400|       }
#  401|       for (i = 0; i < nx - 1; i++) {
#  402|->         ycent1[i] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  403|           sum += arraysum[w2 + i] - arraysum[i];
#  404|           moment += arraymoment[w2 + i] - arraymoment[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1672]
leptonica-1.87.0/src/recogdid.c:402:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/recogdid.c:401:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogdid.c:402:9: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:402:9: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogdid.c:402:9: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:402:9: danger: ‘ycent1 + (long unsigned int)i * 4’ could be NULL: unchecked value from [(17)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/16)
#  400|       }
#  401|       for (i = 0; i < nx - 1; i++) {
#  402|->         ycent1[i] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  403|           sum += arraysum[w2 + i] - arraysum[i];
#  404|           moment += arraymoment[w2 + i] - arraymoment[i];

Error: CPPCHECK_WARNING (CWE-476): [#def1673]
leptonica-1.87.0/src/recogdid.c:406: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ycent1
#  404|           moment += arraymoment[w2 + i] - arraymoment[i];
#  405|       }
#  406|->     ycent1[nx - 1] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  407|   
#  408|           /* Compute the bit-and sum between the template pix2 and pix1, at

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1674]
leptonica-1.87.0/src/recogdid.c:416:12: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: allocated here
leptonica-1.87.0/src/recogdid.c:401:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:406:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:416:12: throw: if ‘pixCreate’ throws an exception...
leptonica-1.87.0/src/recogdid.c:416:12: danger: ‘ycent1’ leaks here; was allocated at [(17)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/16)
#  414|            *      are within the intersection of pix1 and the shifted pix2.
#  415|            *  (3) AND pix1 with pix3. */
#  416|->     pix3 = pixCreate(w2, h1, 1);
#  417|       for (i = 0; i < nx; i++) {
#  418|           shifty = (l_int32)(ycent1[i] - ycent2 + 0.5);

Error: CPPCHECK_WARNING (CWE-476): [#def1675]
leptonica-1.87.0/src/recogdid.c:418: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ycent1
#  416|       pix3 = pixCreate(w2, h1, 1);
#  417|       for (i = 0; i < nx; i++) {
#  418|->         shifty = (l_int32)(ycent1[i] - ycent2 + 0.5);
#  419|           maxcount = 0;
#  420|           maxdely = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1676]
leptonica-1.87.0/src/recogdid.c:418:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/recogdid.c:401:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:406:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:417:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogdid.c:418:34: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:418:28: danger: ‘ycent1 + (long unsigned int)i * 4’ could be NULL: unchecked value from [(17)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/16)
#  416|       pix3 = pixCreate(w2, h1, 1);
#  417|       for (i = 0; i < nx; i++) {
#  418|->         shifty = (l_int32)(ycent1[i] - ycent2 + 0.5);
#  419|           maxcount = 0;
#  420|           maxdely = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1677]
leptonica-1.87.0/src/recogdid.c:422:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: allocated here
leptonica-1.87.0/src/recogdid.c:417:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogdid.c:418:34: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:421:30: branch_true: following ‘true’ branch (when ‘j != 2’)...
leptonica-1.87.0/src/recogdid.c:422:13: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:422:13: throw: if ‘pixClearAll’ throws an exception...
leptonica-1.87.0/src/recogdid.c:422:13: danger: ‘ycent1’ leaks here; was allocated at [(17)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/16)
#  420|           maxdely = 0;
#  421|           for (j = -MaxYShift; j <= MaxYShift; j++) {
#  422|->             pixClearAll(pix3);
#  423|               dely = shifty + j;  /* amount pix2 is shifted relative to pix1 */
#  424|               pixRasterop(pix3, 0, dely, w2, h2, PIX_SRC, pix2, 0, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1678]
leptonica-1.87.0/src/recogdid.c:424:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: allocated here
leptonica-1.87.0/src/recogdid.c:417:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogdid.c:418:34: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:421:30: branch_true: following ‘true’ branch (when ‘j != 2’)...
leptonica-1.87.0/src/recogdid.c:422:13: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:424:13: throw: if ‘pixRasterop’ throws an exception...
leptonica-1.87.0/src/recogdid.c:424:13: danger: ‘ycent1’ leaks here; was allocated at [(17)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/16)
#  422|               pixClearAll(pix3);
#  423|               dely = shifty + j;  /* amount pix2 is shifted relative to pix1 */
#  424|->             pixRasterop(pix3, 0, dely, w2, h2, PIX_SRC, pix2, 0, 0);
#  425|               pixRasterop(pix3, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);
#  426|               pixCountPixels(pix3, &count, sumtab);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1679]
leptonica-1.87.0/src/recogdid.c:425:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: allocated here
leptonica-1.87.0/src/recogdid.c:417:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogdid.c:418:34: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:421:30: branch_true: following ‘true’ branch (when ‘j != 2’)...
leptonica-1.87.0/src/recogdid.c:422:13: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:425:13: throw: if ‘pixRasterop’ throws an exception...
leptonica-1.87.0/src/recogdid.c:425:13: danger: ‘ycent1’ leaks here; was allocated at [(17)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/16)
#  423|               dely = shifty + j;  /* amount pix2 is shifted relative to pix1 */
#  424|               pixRasterop(pix3, 0, dely, w2, h2, PIX_SRC, pix2, 0, 0);
#  425|->             pixRasterop(pix3, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);
#  426|               pixCountPixels(pix3, &count, sumtab);
#  427|               if (count > maxcount) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1680]
leptonica-1.87.0/src/recogdid.c:426:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: allocated here
leptonica-1.87.0/src/recogdid.c:417:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogdid.c:418:34: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:421:30: branch_true: following ‘true’ branch (when ‘j != 2’)...
leptonica-1.87.0/src/recogdid.c:422:13: branch_true: ...to here
leptonica-1.87.0/src/recogdid.c:426:13: throw: if ‘pixCountPixels’ throws an exception...
leptonica-1.87.0/src/recogdid.c:426:13: danger: ‘ycent1’ leaks here; was allocated at [(17)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/16)
#  424|               pixRasterop(pix3, 0, dely, w2, h2, PIX_SRC, pix2, 0, 0);
#  425|               pixRasterop(pix3, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);
#  426|->             pixCountPixels(pix3, &count, sumtab);
#  427|               if (count > maxcount) {
#  428|                   maxcount = count;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1681]
leptonica-1.87.0/src/recogdid.c:437:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: allocated here
leptonica-1.87.0/src/recogdid.c:401:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:406:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:417:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogdid.c:435:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:437:5: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/recogdid.c:437:5: danger: ‘ycent1’ leaks here; was allocated at [(17)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/16)
#  435|       did->fullarrays = TRUE;
#  436|   
#  437|->     pixDestroy(&pix2);
#  438|       pixDestroy(&pix3);
#  439|       LEPT_FREE(ycent1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1682]
leptonica-1.87.0/src/recogdid.c:438:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogdid.c:355:1: enter_function: entry to ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:366:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogdid.c:368:16: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:368:16: call_function: calling ‘recogGetDid’ from ‘recogMakeDecodingArray’
leptonica-1.87.0/src/recogdid.c:368:16: return_function: returning to ‘recogMakeDecodingArray’ from ‘recogGetDid’
leptonica-1.87.0/src/recogdid.c:368:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:370:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:378:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:384:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:394:25: acquire_memory: allocated here
leptonica-1.87.0/src/recogdid.c:401:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogdid.c:406:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:417:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogdid.c:435:5: branch_false: ...to here
leptonica-1.87.0/src/recogdid.c:438:5: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/recogdid.c:438:5: danger: ‘ycent1’ leaks here; was allocated at [(17)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/16)
#  436|   
#  437|       pixDestroy(&pix2);
#  438|->     pixDestroy(&pix3);
#  439|       LEPT_FREE(ycent1);
#  440|       LEPT_FREE(arraysum);

Error: CPPCHECK_WARNING (CWE-476): [#def1683]
leptonica-1.87.0/src/recogdid.c:758: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  756|       did = (L_RDID *)LEPT_CALLOC(1, sizeof(L_RDID));
#  757|       recog->did = did;
#  758|->     did->pixs = pixClone(pixs);
#  759|       did->narray = recog->setsize;
#  760|       did->size = pixGetWidth(pixs);

Error: CPPCHECK_WARNING (CWE-476): [#def1684]
leptonica-1.87.0/src/recogdid.c:759: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  757|       recog->did = did;
#  758|       did->pixs = pixClone(pixs);
#  759|->     did->narray = recog->setsize;
#  760|       did->size = pixGetWidth(pixs);
#  761|       did->natempl = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1685]
leptonica-1.87.0/src/recogdid.c:760: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  758|       did->pixs = pixClone(pixs);
#  759|       did->narray = recog->setsize;
#  760|->     did->size = pixGetWidth(pixs);
#  761|       did->natempl = numaCreate(5);
#  762|       did->naxloc = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1686]
leptonica-1.87.0/src/recogdid.c:761: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  759|       did->narray = recog->setsize;
#  760|       did->size = pixGetWidth(pixs);
#  761|->     did->natempl = numaCreate(5);
#  762|       did->naxloc = numaCreate(5);
#  763|       did->nadely = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1687]
leptonica-1.87.0/src/recogdid.c:762: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  760|       did->size = pixGetWidth(pixs);
#  761|       did->natempl = numaCreate(5);
#  762|->     did->naxloc = numaCreate(5);
#  763|       did->nadely = numaCreate(5);
#  764|       did->nawidth = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1688]
leptonica-1.87.0/src/recogdid.c:763: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  761|       did->natempl = numaCreate(5);
#  762|       did->naxloc = numaCreate(5);
#  763|->     did->nadely = numaCreate(5);
#  764|       did->nawidth = numaCreate(5);
#  765|       did->boxa = boxaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1689]
leptonica-1.87.0/src/recogdid.c:764: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  762|       did->naxloc = numaCreate(5);
#  763|       did->nadely = numaCreate(5);
#  764|->     did->nawidth = numaCreate(5);
#  765|       did->boxa = boxaCreate(5);
#  766|       did->nascore = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1690]
leptonica-1.87.0/src/recogdid.c:765: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  763|       did->nadely = numaCreate(5);
#  764|       did->nawidth = numaCreate(5);
#  765|->     did->boxa = boxaCreate(5);
#  766|       did->nascore = numaCreate(5);
#  767|       did->natempl_r = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1691]
leptonica-1.87.0/src/recogdid.c:766: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  764|       did->nawidth = numaCreate(5);
#  765|       did->boxa = boxaCreate(5);
#  766|->     did->nascore = numaCreate(5);
#  767|       did->natempl_r = numaCreate(5);
#  768|       did->nasample_r = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1692]
leptonica-1.87.0/src/recogdid.c:767: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  765|       did->boxa = boxaCreate(5);
#  766|       did->nascore = numaCreate(5);
#  767|->     did->natempl_r = numaCreate(5);
#  768|       did->nasample_r = numaCreate(5);
#  769|       did->naxloc_r = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1693]
leptonica-1.87.0/src/recogdid.c:768: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  766|       did->nascore = numaCreate(5);
#  767|       did->natempl_r = numaCreate(5);
#  768|->     did->nasample_r = numaCreate(5);
#  769|       did->naxloc_r = numaCreate(5);
#  770|       did->nadely_r = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1694]
leptonica-1.87.0/src/recogdid.c:769: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  767|       did->natempl_r = numaCreate(5);
#  768|       did->nasample_r = numaCreate(5);
#  769|->     did->naxloc_r = numaCreate(5);
#  770|       did->nadely_r = numaCreate(5);
#  771|       did->nawidth_r = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1695]
leptonica-1.87.0/src/recogdid.c:770: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  768|       did->nasample_r = numaCreate(5);
#  769|       did->naxloc_r = numaCreate(5);
#  770|->     did->nadely_r = numaCreate(5);
#  771|       did->nawidth_r = numaCreate(5);
#  772|       did->nascore_r = numaCreate(5);

Error: CPPCHECK_WARNING (CWE-476): [#def1696]
leptonica-1.87.0/src/recogdid.c:771: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  769|       did->naxloc_r = numaCreate(5);
#  770|       did->nadely_r = numaCreate(5);
#  771|->     did->nawidth_r = numaCreate(5);
#  772|       did->nascore_r = numaCreate(5);
#  773|   

Error: CPPCHECK_WARNING (CWE-476): [#def1697]
leptonica-1.87.0/src/recogdid.c:772: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  770|       did->nadely_r = numaCreate(5);
#  771|       did->nawidth_r = numaCreate(5);
#  772|->     did->nascore_r = numaCreate(5);
#  773|   
#  774|           /* Make the arrays */

Error: CPPCHECK_WARNING (CWE-476): [#def1698]
leptonica-1.87.0/src/recogdid.c:775: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  773|   
#  774|           /* Make the arrays */
#  775|->     did->setwidth = (l_int32 *)LEPT_CALLOC(did->narray, sizeof(l_int32));
#  776|       did->counta = (l_int32 **)LEPT_CALLOC(did->narray, sizeof(l_int32 *));
#  777|       did->delya = (l_int32 **)LEPT_CALLOC(did->narray, sizeof(l_int32 *));

Error: CPPCHECK_WARNING (CWE-476): [#def1699]
leptonica-1.87.0/src/recogdid.c:776: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  774|           /* Make the arrays */
#  775|       did->setwidth = (l_int32 *)LEPT_CALLOC(did->narray, sizeof(l_int32));
#  776|->     did->counta = (l_int32 **)LEPT_CALLOC(did->narray, sizeof(l_int32 *));
#  777|       did->delya = (l_int32 **)LEPT_CALLOC(did->narray, sizeof(l_int32 *));
#  778|       did->beta = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));

Error: CPPCHECK_WARNING (CWE-476): [#def1700]
leptonica-1.87.0/src/recogdid.c:777: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  775|       did->setwidth = (l_int32 *)LEPT_CALLOC(did->narray, sizeof(l_int32));
#  776|       did->counta = (l_int32 **)LEPT_CALLOC(did->narray, sizeof(l_int32 *));
#  777|->     did->delya = (l_int32 **)LEPT_CALLOC(did->narray, sizeof(l_int32 *));
#  778|       did->beta = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));
#  779|       did->gamma = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));

Error: CPPCHECK_WARNING (CWE-476): [#def1701]
leptonica-1.87.0/src/recogdid.c:778: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  776|       did->counta = (l_int32 **)LEPT_CALLOC(did->narray, sizeof(l_int32 *));
#  777|       did->delya = (l_int32 **)LEPT_CALLOC(did->narray, sizeof(l_int32 *));
#  778|->     did->beta = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));
#  779|       did->gamma = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));
#  780|       did->trellisscore = (l_float32 *)LEPT_CALLOC(did->size, sizeof(l_float32));

Error: CPPCHECK_WARNING (CWE-476): [#def1702]
leptonica-1.87.0/src/recogdid.c:779: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  777|       did->delya = (l_int32 **)LEPT_CALLOC(did->narray, sizeof(l_int32 *));
#  778|       did->beta = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));
#  779|->     did->gamma = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));
#  780|       did->trellisscore = (l_float32 *)LEPT_CALLOC(did->size, sizeof(l_float32));
#  781|       did->trellistempl = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));

Error: CPPCHECK_WARNING (CWE-476): [#def1703]
leptonica-1.87.0/src/recogdid.c:780: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  778|       did->beta = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));
#  779|       did->gamma = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));
#  780|->     did->trellisscore = (l_float32 *)LEPT_CALLOC(did->size, sizeof(l_float32));
#  781|       did->trellistempl = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  782|       for (i = 0; i < did->narray; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def1704]
leptonica-1.87.0/src/recogdid.c:781: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  779|       did->gamma = (l_float32 *)LEPT_CALLOC(5, sizeof(l_float32));
#  780|       did->trellisscore = (l_float32 *)LEPT_CALLOC(did->size, sizeof(l_float32));
#  781|->     did->trellistempl = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  782|       for (i = 0; i < did->narray; i++) {
#  783|           did->counta[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));

Error: CPPCHECK_WARNING (CWE-476): [#def1705]
leptonica-1.87.0/src/recogdid.c:782: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  780|       did->trellisscore = (l_float32 *)LEPT_CALLOC(did->size, sizeof(l_float32));
#  781|       did->trellistempl = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  782|->     for (i = 0; i < did->narray; i++) {
#  783|           did->counta[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  784|           did->delya[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));

Error: CPPCHECK_WARNING (CWE-476): [#def1706]
leptonica-1.87.0/src/recogdid.c:783: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  781|       did->trellistempl = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  782|       for (i = 0; i < did->narray; i++) {
#  783|->         did->counta[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  784|           did->delya[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  785|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1707]
leptonica-1.87.0/src/recogdid.c:784: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  782|       for (i = 0; i < did->narray; i++) {
#  783|           did->counta[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  784|->         did->delya[i] = (l_int32 *)LEPT_CALLOC(did->size, sizeof(l_int32));
#  785|       }
#  786|   

Error: CPPCHECK_WARNING (CWE-476): [#def1708]
leptonica-1.87.0/src/recogdid.c:788: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  786|   
#  787|           /* Populate the setwidth array */
#  788|->     for (i = 0; i < did->narray; i++) {
#  789|           pix1 = pixaGetPix(recog->pixa_u, i, L_CLONE);
#  790|           did->setwidth[i] = (l_int32)(SetwidthFraction * pixGetWidth(pix1));

Error: CPPCHECK_WARNING (CWE-476): [#def1709]
leptonica-1.87.0/src/recogdid.c:790: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: did
#  788|       for (i = 0; i < did->narray; i++) {
#  789|           pix1 = pixaGetPix(recog->pixa_u, i, L_CLONE);
#  790|->         did->setwidth[i] = (l_int32)(SetwidthFraction * pixGetWidth(pix1));
#  791|           pixDestroy(&pix1);
#  792|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1710]
leptonica-1.87.0/src/recogident.c:780:16: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:780:16: throw: if ‘numaGetIArray’ throws an exception...
leptonica-1.87.0/src/recogident.c:780:16: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  778|       area1 = (l_int32 *)LEPT_CALLOC(nx, sizeof(l_int32));
#  779|       ycent1 = (l_float32 *)LEPT_CALLOC(nx, sizeof(l_int32));
#  780|->     arraysum = numaGetIArray(nasum1);
#  781|       arraymoment = numaGetIArray(namoment1);
#  782|       for (i = 0, sum = 0, moment = 0; i < w2; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1711]
leptonica-1.87.0/src/recogident.c:780:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:780:16: throw: if ‘numaGetIArray’ throws an exception...
leptonica-1.87.0/src/recogident.c:780:16: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  778|       area1 = (l_int32 *)LEPT_CALLOC(nx, sizeof(l_int32));
#  779|       ycent1 = (l_float32 *)LEPT_CALLOC(nx, sizeof(l_int32));
#  780|->     arraysum = numaGetIArray(nasum1);
#  781|       arraymoment = numaGetIArray(namoment1);
#  782|       for (i = 0, sum = 0, moment = 0; i < w2; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1712]
leptonica-1.87.0/src/recogident.c:781:19: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:781:19: throw: if ‘numaGetIArray’ throws an exception...
leptonica-1.87.0/src/recogident.c:781:19: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  779|       ycent1 = (l_float32 *)LEPT_CALLOC(nx, sizeof(l_int32));
#  780|       arraysum = numaGetIArray(nasum1);
#  781|->     arraymoment = numaGetIArray(namoment1);
#  782|       for (i = 0, sum = 0, moment = 0; i < w2; i++) {
#  783|           sum += arraysum[i];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1713]
leptonica-1.87.0/src/recogident.c:781:19: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:781:19: throw: if ‘numaGetIArray’ throws an exception...
leptonica-1.87.0/src/recogident.c:781:19: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/12)
#  779|       ycent1 = (l_float32 *)LEPT_CALLOC(nx, sizeof(l_int32));
#  780|       arraysum = numaGetIArray(nasum1);
#  781|->     arraymoment = numaGetIArray(namoment1);
#  782|       for (i = 0, sum = 0, moment = 0; i < w2; i++) {
#  783|           sum += arraysum[i];

Error: CPPCHECK_WARNING (CWE-476): [#def1714]
leptonica-1.87.0/src/recogident.c:787: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: area1
#  785|       }
#  786|       for (i = 0; i < nx - 1; i++) {
#  787|->         area1[i] = sum;
#  788|           ycent1[i] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  789|           sum += arraysum[w2 + i] - arraysum[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1715]
leptonica-1.87.0/src/recogident.c:787:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:787:9: danger: ‘area1 + (long unsigned int)i * 4’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/12)
#  785|       }
#  786|       for (i = 0; i < nx - 1; i++) {
#  787|->         area1[i] = sum;
#  788|           ycent1[i] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  789|           sum += arraysum[w2 + i] - arraysum[i];

Error: CPPCHECK_WARNING (CWE-476): [#def1716]
leptonica-1.87.0/src/recogident.c:788: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ycent1
#  786|       for (i = 0; i < nx - 1; i++) {
#  787|           area1[i] = sum;
#  788|->         ycent1[i] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  789|           sum += arraysum[w2 + i] - arraysum[i];
#  790|           moment += arraymoment[w2 + i] - arraymoment[i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1717]
leptonica-1.87.0/src/recogident.c:788:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:9: danger: ‘ycent1 + (long unsigned int)i * 4’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/12)
#  786|       for (i = 0; i < nx - 1; i++) {
#  787|           area1[i] = sum;
#  788|->         ycent1[i] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  789|           sum += arraysum[w2 + i] - arraysum[i];
#  790|           moment += arraymoment[w2 + i] - arraymoment[i];

Error: CPPCHECK_WARNING (CWE-476): [#def1718]
leptonica-1.87.0/src/recogident.c:792: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: area1
#  790|           moment += arraymoment[w2 + i] - arraymoment[i];
#  791|       }
#  792|->     area1[nx - 1] = sum;
#  793|       ycent1[nx - 1] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  794|   

Error: CPPCHECK_WARNING (CWE-476): [#def1719]
leptonica-1.87.0/src/recogident.c:793: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ycent1
#  791|       }
#  792|       area1[nx - 1] = sum;
#  793|->     ycent1[nx - 1] = (sum == 0) ? ycent2 : (l_float32)moment / (l_float32)sum;
#  794|   
#  795|           /* Find the best match location for pix2.  At each location,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1720]
leptonica-1.87.0/src/recogident.c:802:12: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:802:12: throw: if ‘pixCreate’ throws an exception...
leptonica-1.87.0/src/recogident.c:802:12: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/12)
#  800|            *      are within the intersection of pix1 and the shifted pix2.
#  801|            *  (3) AND pix1 with pixt. */
#  802|->     pixt = pixCreate(w2, h1, 1);
#  803|       maxscore = 0;
#  804|       delx = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1721]
leptonica-1.87.0/src/recogident.c:802:12: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:802:12: throw: if ‘pixCreate’ throws an exception...
leptonica-1.87.0/src/recogident.c:802:12: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
#  800|            *      are within the intersection of pix1 and the shifted pix2.
#  801|            *  (3) AND pix1 with pixt. */
#  802|->     pixt = pixCreate(w2, h1, 1);
#  803|       maxscore = 0;
#  804|       delx = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def1722]
leptonica-1.87.0/src/recogident.c:807: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ycent1
#  805|       dely = 0;  /* amount to shift pix2 relative to pix1 to get alignment */
#  806|       for (i = 0; i < nx; i++) {
#  807|->         shifty = (l_int32)(ycent1[i] - ycent2 + 0.5);
#  808|           for (j = -maxyshift; j <= maxyshift; j++) {
#  809|               pixClearAll(pixt);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1723]
leptonica-1.87.0/src/recogident.c:807:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: this call could return NULL
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:807:28: danger: ‘ycent1 + (long unsigned int)i * 4’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/12)
#  805|       dely = 0;  /* amount to shift pix2 relative to pix1 to get alignment */
#  806|       for (i = 0; i < nx; i++) {
#  807|->         shifty = (l_int32)(ycent1[i] - ycent2 + 0.5);
#  808|           for (j = -maxyshift; j <= maxyshift; j++) {
#  809|               pixClearAll(pixt);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1724]
leptonica-1.87.0/src/recogident.c:809:13: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:808:30: branch_true: following ‘true’ branch (when ‘j <= maxyshift’)...
leptonica-1.87.0/src/recogident.c:809:13: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:809:13: throw: if ‘pixClearAll’ throws an exception...
leptonica-1.87.0/src/recogident.c:809:13: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/12)
#  807|           shifty = (l_int32)(ycent1[i] - ycent2 + 0.5);
#  808|           for (j = -maxyshift; j <= maxyshift; j++) {
#  809|->             pixClearAll(pixt);
#  810|               pixRasterop(pixt, 0, shifty + j, w2, h2, PIX_SRC, pix2, 0, 0);
#  811|               pixRasterop(pixt, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1725]
leptonica-1.87.0/src/recogident.c:809:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:808:30: branch_true: following ‘true’ branch (when ‘j <= maxyshift’)...
leptonica-1.87.0/src/recogident.c:809:13: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:809:13: throw: if ‘pixClearAll’ throws an exception...
leptonica-1.87.0/src/recogident.c:809:13: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/12)
#  807|           shifty = (l_int32)(ycent1[i] - ycent2 + 0.5);
#  808|           for (j = -maxyshift; j <= maxyshift; j++) {
#  809|->             pixClearAll(pixt);
#  810|               pixRasterop(pixt, 0, shifty + j, w2, h2, PIX_SRC, pix2, 0, 0);
#  811|               pixRasterop(pixt, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1726]
leptonica-1.87.0/src/recogident.c:810:13: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:808:30: branch_true: following ‘true’ branch (when ‘j <= maxyshift’)...
leptonica-1.87.0/src/recogident.c:809:13: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:810:13: throw: if ‘pixRasterop’ throws an exception...
leptonica-1.87.0/src/recogident.c:810:13: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/12)
#  808|           for (j = -maxyshift; j <= maxyshift; j++) {
#  809|               pixClearAll(pixt);
#  810|->             pixRasterop(pixt, 0, shifty + j, w2, h2, PIX_SRC, pix2, 0, 0);
#  811|               pixRasterop(pixt, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);
#  812|               pixCountPixels(pixt, &count, tab);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1727]
leptonica-1.87.0/src/recogident.c:810:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:808:30: branch_true: following ‘true’ branch (when ‘j <= maxyshift’)...
leptonica-1.87.0/src/recogident.c:809:13: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:810:13: throw: if ‘pixRasterop’ throws an exception...
leptonica-1.87.0/src/recogident.c:810:13: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/12)
#  808|           for (j = -maxyshift; j <= maxyshift; j++) {
#  809|               pixClearAll(pixt);
#  810|->             pixRasterop(pixt, 0, shifty + j, w2, h2, PIX_SRC, pix2, 0, 0);
#  811|               pixRasterop(pixt, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);
#  812|               pixCountPixels(pixt, &count, tab);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1728]
leptonica-1.87.0/src/recogident.c:811:13: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:808:30: branch_true: following ‘true’ branch (when ‘j <= maxyshift’)...
leptonica-1.87.0/src/recogident.c:809:13: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:811:13: throw: if ‘pixRasterop’ throws an exception...
leptonica-1.87.0/src/recogident.c:811:13: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/12)
#  809|               pixClearAll(pixt);
#  810|               pixRasterop(pixt, 0, shifty + j, w2, h2, PIX_SRC, pix2, 0, 0);
#  811|->             pixRasterop(pixt, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);
#  812|               pixCountPixels(pixt, &count, tab);
#  813|               score = (l_float32)count * (l_float32)count /

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1729]
leptonica-1.87.0/src/recogident.c:811:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:808:30: branch_true: following ‘true’ branch (when ‘j <= maxyshift’)...
leptonica-1.87.0/src/recogident.c:809:13: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:811:13: throw: if ‘pixRasterop’ throws an exception...
leptonica-1.87.0/src/recogident.c:811:13: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/12)
#  809|               pixClearAll(pixt);
#  810|               pixRasterop(pixt, 0, shifty + j, w2, h2, PIX_SRC, pix2, 0, 0);
#  811|->             pixRasterop(pixt, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);
#  812|               pixCountPixels(pixt, &count, tab);
#  813|               score = (l_float32)count * (l_float32)count /

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1730]
leptonica-1.87.0/src/recogident.c:812:13: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:808:30: branch_true: following ‘true’ branch (when ‘j <= maxyshift’)...
leptonica-1.87.0/src/recogident.c:809:13: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:812:13: throw: if ‘pixCountPixels’ throws an exception...
leptonica-1.87.0/src/recogident.c:812:13: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/12)
#  810|               pixRasterop(pixt, 0, shifty + j, w2, h2, PIX_SRC, pix2, 0, 0);
#  811|               pixRasterop(pixt, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);
#  812|->             pixCountPixels(pixt, &count, tab);
#  813|               score = (l_float32)count * (l_float32)count /
#  814|                       ((l_float32)area1[i] * (l_float32)area2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1731]
leptonica-1.87.0/src/recogident.c:812:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_false: following ‘false’ branch (when ‘debugflag <= 0’)...
leptonica-1.87.0/src/recogident.c:771:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:808:30: branch_true: following ‘true’ branch (when ‘j <= maxyshift’)...
leptonica-1.87.0/src/recogident.c:809:13: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:812:13: throw: if ‘pixCountPixels’ throws an exception...
leptonica-1.87.0/src/recogident.c:812:13: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/12)
#  810|               pixRasterop(pixt, 0, shifty + j, w2, h2, PIX_SRC, pix2, 0, 0);
#  811|               pixRasterop(pixt, 0, 0, w2, h1, PIX_SRC & PIX_DST, pix1, i, 0);
#  812|->             pixCountPixels(pixt, &count, tab);
#  813|               score = (l_float32)count * (l_float32)count /
#  814|                       ((l_float32)area1[i] * (l_float32)area2);

Error: CPPCHECK_WARNING (CWE-476): [#def1732]
leptonica-1.87.0/src/recogident.c:814: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: area1
#  812|               pixCountPixels(pixt, &count, tab);
#  813|               score = (l_float32)count * (l_float32)count /
#  814|->                     ((l_float32)area1[i] * (l_float32)area2);
#  815|               if (score > maxscore) {
#  816|                   maxscore = score;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1733]
leptonica-1.87.0/src/recogident.c:822:17: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:815:16: branch_true: following ‘true’ branch (when ‘maxscore < score’)...
leptonica-1.87.0/src/recogident.c:815:16: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:821:16: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:822:17: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:822:17: throw: if ‘fpixSetPixel’ throws an exception...
leptonica-1.87.0/src/recogident.c:822:17: danger: ‘area1’ leaks here; was allocated at [(11)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/10)
#  820|   
#  821|               if (debugflag > 0)
#  822|->                 fpixSetPixel(fpix, i, maxyshift + j, 1000.0 * score);
#  823|           }
#  824|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1734]
leptonica-1.87.0/src/recogident.c:822:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/recogident.c:787:14: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:788:21: branch_true: following ‘true’ branch (when ‘sum == 0’)...
leptonica-1.87.0/src/recogident.c:788:21: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_true: following ‘true’ branch (when ‘i < nx’)...
leptonica-1.87.0/src/recogident.c:807:34: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:815:16: branch_true: following ‘true’ branch (when ‘maxscore < score’)...
leptonica-1.87.0/src/recogident.c:815:16: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:821:16: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:822:17: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:822:17: throw: if ‘fpixSetPixel’ throws an exception...
leptonica-1.87.0/src/recogident.c:822:17: danger: ‘ycent1’ leaks here; was allocated at [(11)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/10)
#  820|   
#  821|               if (debugflag > 0)
#  822|->                 fpixSetPixel(fpix, i, maxyshift + j, 1000.0 * score);
#  823|           }
#  824|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1735]
leptonica-1.87.0/src/recogident.c:828:9: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:828:9: throw: if ‘lept_mkdir’ throws an exception...
leptonica-1.87.0/src/recogident.c:828:9: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/12)
#  826|       if (debugflag > 0) {
#  827|           char  buf[128];
#  828|->         lept_mkdir("lept/recog");
#  829|           pixt1 = fpixDisplayMaxDynamicRange(fpix);
#  830|           pixt2 = pixExpandReplicate(pixt1, 5);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1736]
leptonica-1.87.0/src/recogident.c:828:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:828:9: throw: if ‘lept_mkdir’ throws an exception...
leptonica-1.87.0/src/recogident.c:828:9: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/12)
#  826|       if (debugflag > 0) {
#  827|           char  buf[128];
#  828|->         lept_mkdir("lept/recog");
#  829|           pixt1 = fpixDisplayMaxDynamicRange(fpix);
#  830|           pixt2 = pixExpandReplicate(pixt1, 5);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1737]
leptonica-1.87.0/src/recogident.c:829:17: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:829:17: throw: if ‘fpixDisplayMaxDynamicRange’ throws an exception...
leptonica-1.87.0/src/recogident.c:829:17: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/12)
#  827|           char  buf[128];
#  828|           lept_mkdir("lept/recog");
#  829|->         pixt1 = fpixDisplayMaxDynamicRange(fpix);
#  830|           pixt2 = pixExpandReplicate(pixt1, 5);
#  831|           snprintf(buf, sizeof(buf), "/tmp/lept/recog/junkbs_%d.png", debugflag);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1738]
leptonica-1.87.0/src/recogident.c:829:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:829:17: throw: if ‘fpixDisplayMaxDynamicRange’ throws an exception...
leptonica-1.87.0/src/recogident.c:829:17: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/12)
#  827|           char  buf[128];
#  828|           lept_mkdir("lept/recog");
#  829|->         pixt1 = fpixDisplayMaxDynamicRange(fpix);
#  830|           pixt2 = pixExpandReplicate(pixt1, 5);
#  831|           snprintf(buf, sizeof(buf), "/tmp/lept/recog/junkbs_%d.png", debugflag);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1739]
leptonica-1.87.0/src/recogident.c:830:17: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:830:17: throw: if ‘pixExpandReplicate’ throws an exception...
leptonica-1.87.0/src/recogident.c:830:17: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/12)
#  828|           lept_mkdir("lept/recog");
#  829|           pixt1 = fpixDisplayMaxDynamicRange(fpix);
#  830|->         pixt2 = pixExpandReplicate(pixt1, 5);
#  831|           snprintf(buf, sizeof(buf), "/tmp/lept/recog/junkbs_%d.png", debugflag);
#  832|           pixWrite(buf, pixt2, IFF_PNG);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1740]
leptonica-1.87.0/src/recogident.c:830:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:830:17: throw: if ‘pixExpandReplicate’ throws an exception...
leptonica-1.87.0/src/recogident.c:830:17: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/12)
#  828|           lept_mkdir("lept/recog");
#  829|           pixt1 = fpixDisplayMaxDynamicRange(fpix);
#  830|->         pixt2 = pixExpandReplicate(pixt1, 5);
#  831|           snprintf(buf, sizeof(buf), "/tmp/lept/recog/junkbs_%d.png", debugflag);
#  832|           pixWrite(buf, pixt2, IFF_PNG);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1741]
leptonica-1.87.0/src/recogident.c:832:9: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:832:9: throw: if ‘pixWrite’ throws an exception...
leptonica-1.87.0/src/recogident.c:832:9: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/12)
#  830|           pixt2 = pixExpandReplicate(pixt1, 5);
#  831|           snprintf(buf, sizeof(buf), "/tmp/lept/recog/junkbs_%d.png", debugflag);
#  832|->         pixWrite(buf, pixt2, IFF_PNG);
#  833|           pixDestroy(&pixt1);
#  834|           pixDestroy(&pixt2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1742]
leptonica-1.87.0/src/recogident.c:832:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:832:9: throw: if ‘pixWrite’ throws an exception...
leptonica-1.87.0/src/recogident.c:832:9: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/12)
#  830|           pixt2 = pixExpandReplicate(pixt1, 5);
#  831|           snprintf(buf, sizeof(buf), "/tmp/lept/recog/junkbs_%d.png", debugflag);
#  832|->         pixWrite(buf, pixt2, IFF_PNG);
#  833|           pixDestroy(&pixt1);
#  834|           pixDestroy(&pixt2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1743]
leptonica-1.87.0/src/recogident.c:833:9: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:833:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/recogident.c:833:9: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/12)
#  831|           snprintf(buf, sizeof(buf), "/tmp/lept/recog/junkbs_%d.png", debugflag);
#  832|           pixWrite(buf, pixt2, IFF_PNG);
#  833|->         pixDestroy(&pixt1);
#  834|           pixDestroy(&pixt2);
#  835|           fpixDestroy(&fpix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1744]
leptonica-1.87.0/src/recogident.c:833:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:833:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/recogident.c:833:9: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/12)
#  831|           snprintf(buf, sizeof(buf), "/tmp/lept/recog/junkbs_%d.png", debugflag);
#  832|           pixWrite(buf, pixt2, IFF_PNG);
#  833|->         pixDestroy(&pixt1);
#  834|           pixDestroy(&pixt2);
#  835|           fpixDestroy(&fpix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1745]
leptonica-1.87.0/src/recogident.c:834:9: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:834:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/recogident.c:834:9: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/12)
#  832|           pixWrite(buf, pixt2, IFF_PNG);
#  833|           pixDestroy(&pixt1);
#  834|->         pixDestroy(&pixt2);
#  835|           fpixDestroy(&fpix);
#  836|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1746]
leptonica-1.87.0/src/recogident.c:834:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:834:9: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/recogident.c:834:9: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/12)
#  832|           pixWrite(buf, pixt2, IFF_PNG);
#  833|           pixDestroy(&pixt1);
#  834|->         pixDestroy(&pixt2);
#  835|           fpixDestroy(&fpix);
#  836|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1747]
leptonica-1.87.0/src/recogident.c:835:9: warning[-Wanalyzer-malloc-leak]: leak of ‘area1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:778:24: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:835:9: throw: if ‘fpixDestroy’ throws an exception...
leptonica-1.87.0/src/recogident.c:835:9: danger: ‘area1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/12)
#  833|           pixDestroy(&pixt1);
#  834|           pixDestroy(&pixt2);
#  835|->         fpixDestroy(&fpix);
#  836|       }
#  837|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1748]
leptonica-1.87.0/src/recogident.c:835:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ycent1’
leptonica-1.87.0/src/recogident.c:746:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:748:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:750:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:752:9: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:752:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:758:5: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:760:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:767:10: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:769:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:770:31: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:779:27: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:786:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/recogident.c:786:17: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:806:17: branch_false: following ‘false’ branch (when ‘i >= nx’)...
leptonica-1.87.0/src/recogident.c:826:8: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:826:8: branch_true: following ‘true’ branch (when ‘debugflag > 0’)...
leptonica-1.87.0/src/recogident.c:828:9: branch_true: ...to here
leptonica-1.87.0/src/recogident.c:835:9: throw: if ‘fpixDestroy’ throws an exception...
leptonica-1.87.0/src/recogident.c:835:9: danger: ‘ycent1’ leaks here; was allocated at [(13)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/12)
#  833|           pixDestroy(&pixt1);
#  834|           pixDestroy(&pixt2);
#  835|->         fpixDestroy(&fpix);
#  836|       }
#  837|   

Error: CPPCHECK_WARNING (CWE-476): [#def1749]
leptonica-1.87.0/src/recogident.c:1140: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rcha
# 1138|   
# 1139|       rcha = (L_RCHA *)LEPT_CALLOC(1, sizeof(L_RCHA));
# 1140|->     rcha->naindex = numaCreate(0);
# 1141|       rcha->nascore = numaCreate(0);
# 1142|       rcha->satext = sarrayCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1750]
leptonica-1.87.0/src/recogident.c:1140:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rcha’
leptonica-1.87.0/src/recogident.c:1139:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/recogident.c:1140:5: danger: ‘rcha’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/0)
# 1138|   
# 1139|       rcha = (L_RCHA *)LEPT_CALLOC(1, sizeof(L_RCHA));
# 1140|->     rcha->naindex = numaCreate(0);
# 1141|       rcha->nascore = numaCreate(0);
# 1142|       rcha->satext = sarrayCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1751]
leptonica-1.87.0/src/recogident.c:1140:21: warning[-Wanalyzer-malloc-leak]: leak of ‘rcha’
leptonica-1.87.0/src/recogident.c:1139:22: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:1140:21: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/recogident.c:1140:21: danger: ‘rcha’ leaks here; was allocated at [(1)](sarif:/runs/0/results/50/codeFlows/0/threadFlows/0/locations/0)
# 1138|   
# 1139|       rcha = (L_RCHA *)LEPT_CALLOC(1, sizeof(L_RCHA));
# 1140|->     rcha->naindex = numaCreate(0);
# 1141|       rcha->nascore = numaCreate(0);
# 1142|       rcha->satext = sarrayCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def1752]
leptonica-1.87.0/src/recogident.c:1141: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rcha
# 1139|       rcha = (L_RCHA *)LEPT_CALLOC(1, sizeof(L_RCHA));
# 1140|       rcha->naindex = numaCreate(0);
# 1141|->     rcha->nascore = numaCreate(0);
# 1142|       rcha->satext = sarrayCreate(0);
# 1143|       rcha->nasample = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1753]
leptonica-1.87.0/src/recogident.c:1141:21: warning[-Wanalyzer-malloc-leak]: leak of ‘rcha’
leptonica-1.87.0/src/recogident.c:1139:22: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:1141:21: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/recogident.c:1141:21: danger: ‘rcha’ leaks here; was allocated at [(1)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/0)
# 1139|       rcha = (L_RCHA *)LEPT_CALLOC(1, sizeof(L_RCHA));
# 1140|       rcha->naindex = numaCreate(0);
# 1141|->     rcha->nascore = numaCreate(0);
# 1142|       rcha->satext = sarrayCreate(0);
# 1143|       rcha->nasample = numaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def1754]
leptonica-1.87.0/src/recogident.c:1142: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rcha
# 1140|       rcha->naindex = numaCreate(0);
# 1141|       rcha->nascore = numaCreate(0);
# 1142|->     rcha->satext = sarrayCreate(0);
# 1143|       rcha->nasample = numaCreate(0);
# 1144|       rcha->naxloc = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1755]
leptonica-1.87.0/src/recogident.c:1142:20: warning[-Wanalyzer-malloc-leak]: leak of ‘rcha’
leptonica-1.87.0/src/recogident.c:1139:22: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:1142:20: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/recogident.c:1142:20: danger: ‘rcha’ leaks here; was allocated at [(1)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/0)
# 1140|       rcha->naindex = numaCreate(0);
# 1141|       rcha->nascore = numaCreate(0);
# 1142|->     rcha->satext = sarrayCreate(0);
# 1143|       rcha->nasample = numaCreate(0);
# 1144|       rcha->naxloc = numaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def1756]
leptonica-1.87.0/src/recogident.c:1143: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rcha
# 1141|       rcha->nascore = numaCreate(0);
# 1142|       rcha->satext = sarrayCreate(0);
# 1143|->     rcha->nasample = numaCreate(0);
# 1144|       rcha->naxloc = numaCreate(0);
# 1145|       rcha->nayloc = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1757]
leptonica-1.87.0/src/recogident.c:1143:22: warning[-Wanalyzer-malloc-leak]: leak of ‘rcha’
leptonica-1.87.0/src/recogident.c:1139:22: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:1143:22: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/recogident.c:1143:22: danger: ‘rcha’ leaks here; was allocated at [(1)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/0)
# 1141|       rcha->nascore = numaCreate(0);
# 1142|       rcha->satext = sarrayCreate(0);
# 1143|->     rcha->nasample = numaCreate(0);
# 1144|       rcha->naxloc = numaCreate(0);
# 1145|       rcha->nayloc = numaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def1758]
leptonica-1.87.0/src/recogident.c:1144: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rcha
# 1142|       rcha->satext = sarrayCreate(0);
# 1143|       rcha->nasample = numaCreate(0);
# 1144|->     rcha->naxloc = numaCreate(0);
# 1145|       rcha->nayloc = numaCreate(0);
# 1146|       rcha->nawidth = numaCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1759]
leptonica-1.87.0/src/recogident.c:1144:20: warning[-Wanalyzer-malloc-leak]: leak of ‘rcha’
leptonica-1.87.0/src/recogident.c:1139:22: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:1144:20: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/recogident.c:1144:20: danger: ‘rcha’ leaks here; was allocated at [(1)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/0)
# 1142|       rcha->satext = sarrayCreate(0);
# 1143|       rcha->nasample = numaCreate(0);
# 1144|->     rcha->naxloc = numaCreate(0);
# 1145|       rcha->nayloc = numaCreate(0);
# 1146|       rcha->nawidth = numaCreate(0);

Error: CPPCHECK_WARNING (CWE-476): [#def1760]
leptonica-1.87.0/src/recogident.c:1145: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rcha
# 1143|       rcha->nasample = numaCreate(0);
# 1144|       rcha->naxloc = numaCreate(0);
# 1145|->     rcha->nayloc = numaCreate(0);
# 1146|       rcha->nawidth = numaCreate(0);
# 1147|       return rcha;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1761]
leptonica-1.87.0/src/recogident.c:1145:20: warning[-Wanalyzer-malloc-leak]: leak of ‘rcha’
leptonica-1.87.0/src/recogident.c:1139:22: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:1145:20: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/recogident.c:1145:20: danger: ‘rcha’ leaks here; was allocated at [(1)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/0)
# 1143|       rcha->nasample = numaCreate(0);
# 1144|       rcha->naxloc = numaCreate(0);
# 1145|->     rcha->nayloc = numaCreate(0);
# 1146|       rcha->nawidth = numaCreate(0);
# 1147|       return rcha;

Error: CPPCHECK_WARNING (CWE-476): [#def1762]
leptonica-1.87.0/src/recogident.c:1146: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rcha
# 1144|       rcha->naxloc = numaCreate(0);
# 1145|       rcha->nayloc = numaCreate(0);
# 1146|->     rcha->nawidth = numaCreate(0);
# 1147|       return rcha;
# 1148|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1763]
leptonica-1.87.0/src/recogident.c:1146:21: warning[-Wanalyzer-malloc-leak]: leak of ‘rcha’
leptonica-1.87.0/src/recogident.c:1139:22: acquire_memory: allocated here
leptonica-1.87.0/src/recogident.c:1146:21: throw: if ‘numaCreate’ throws an exception...
leptonica-1.87.0/src/recogident.c:1146:21: danger: ‘rcha’ leaks here; was allocated at [(1)](sarif:/runs/0/results/56/codeFlows/0/threadFlows/0/locations/0)
# 1144|       rcha->naxloc = numaCreate(0);
# 1145|       rcha->nayloc = numaCreate(0);
# 1146|->     rcha->nawidth = numaCreate(0);
# 1147|       return rcha;
# 1148|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1764]
leptonica-1.87.0/src/recogident.c:1211: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rch
# 1209|   
# 1210|       rch = (L_RCH *)LEPT_CALLOC(1, sizeof(L_RCH));
# 1211|->     rch->index = index;
# 1212|       rch->score = score;
# 1213|       rch->text = text;

Error: CPPCHECK_WARNING (CWE-476): [#def1765]
leptonica-1.87.0/src/recogident.c:1212: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rch
# 1210|       rch = (L_RCH *)LEPT_CALLOC(1, sizeof(L_RCH));
# 1211|       rch->index = index;
# 1212|->     rch->score = score;
# 1213|       rch->text = text;
# 1214|       rch->sample = sample;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1766]
leptonica-1.87.0/src/recogident.c:1212:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rch’
leptonica-1.87.0/src/recogident.c:1111:1: enter_function: entry to ‘recogSkipIdentify’
leptonica-1.87.0/src/recogident.c:1113:8: branch_false: following ‘false’ branch (when ‘recog’ is non-NULL)...
leptonica-1.87.0/src/recogident.c:1117:16: branch_false: ...to here
leptonica-1.87.0/src/recogident.c:1117:5: call_function: calling ‘rchDestroy’ from ‘recogSkipIdentify’
leptonica-1.87.0/src/recogident.c:1117:5: return_function: returning to ‘recogSkipIdentify’ from ‘rchDestroy’
leptonica-1.87.0/src/recogident.c:1118:18: call_function: inlined call to ‘rchCreate’ from ‘recogSkipIdentify’
# 1210|       rch = (L_RCH *)LEPT_CALLOC(1, sizeof(L_RCH));
# 1211|       rch->index = index;
# 1212|->     rch->score = score;
# 1213|       rch->text = text;
# 1214|       rch->sample = sample;

Error: CPPCHECK_WARNING (CWE-476): [#def1767]
leptonica-1.87.0/src/recogident.c:1213: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rch
# 1211|       rch->index = index;
# 1212|       rch->score = score;
# 1213|->     rch->text = text;
# 1214|       rch->sample = sample;
# 1215|       rch->xloc = xloc;

Error: CPPCHECK_WARNING (CWE-476): [#def1768]
leptonica-1.87.0/src/recogident.c:1214: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rch
# 1212|       rch->score = score;
# 1213|       rch->text = text;
# 1214|->     rch->sample = sample;
# 1215|       rch->xloc = xloc;
# 1216|       rch->yloc = yloc;

Error: CPPCHECK_WARNING (CWE-476): [#def1769]
leptonica-1.87.0/src/recogident.c:1215: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rch
# 1213|       rch->text = text;
# 1214|       rch->sample = sample;
# 1215|->     rch->xloc = xloc;
# 1216|       rch->yloc = yloc;
# 1217|       rch->width = width;

Error: CPPCHECK_WARNING (CWE-476): [#def1770]
leptonica-1.87.0/src/recogident.c:1216: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rch
# 1214|       rch->sample = sample;
# 1215|       rch->xloc = xloc;
# 1216|->     rch->yloc = yloc;
# 1217|       rch->width = width;
# 1218|       return rch;

Error: CPPCHECK_WARNING (CWE-476): [#def1771]
leptonica-1.87.0/src/recogident.c:1217: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rch
# 1215|       rch->xloc = xloc;
# 1216|       rch->yloc = yloc;
# 1217|->     rch->width = width;
# 1218|       return rch;
# 1219|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1772]
leptonica-1.87.0/src/recogident.c:1783: warning[nullPointer]: Possible null pointer dereference: scorestr
# 1781|                if (j < nchar - 1) stringJoinIP(&scorestr, ",");
# 1782|           }
# 1783|->         snprintf(buf, sizeof(buf), "%s: %s\n", textstr, scorestr);
# 1784|           pix4 = pixAddTextlines(pix3, bmf, buf, 0xff000000, L_ADD_BELOW);
# 1785|           pixaAddPix(pixa, pix4, L_INSERT);

Error: CPPCHECK_WARNING (CWE-476): [#def1773]
leptonica-1.87.0/src/regutils.c:144: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rp
#  142|       rp = (L_REGPARAMS *)LEPT_CALLOC(1, sizeof(L_REGPARAMS));
#  143|       *prp = rp;
#  144|->     rp->testname = testname;
#  145|       rp->index = -1;  /* increment before each test */
#  146|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1774]
leptonica-1.87.0/src/regutils.c:144:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rp’
leptonica-1.87.0/src/regutils.c:123:1: enter_function: entry to ‘regTestSetup’
leptonica-1.87.0/src/regutils.c:131:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/regutils.c:137:21: branch_false: ...to here
leptonica-1.87.0/src/regutils.c:137:21: call_function: calling ‘getRootNameFromArgv0’ from ‘regTestSetup’
leptonica-1.87.0/src/regutils.c:137:21: return_function: returning to ‘regTestSetup’ from ‘getRootNameFromArgv0’
leptonica-1.87.0/src/regutils.c:137:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/regutils.c:140:5: branch_false: ...to here
leptonica-1.87.0/src/regutils.c:142:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/regutils.c:144:5: danger: ‘rp’ could be NULL: unchecked value from [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  142|       rp = (L_REGPARAMS *)LEPT_CALLOC(1, sizeof(L_REGPARAMS));
#  143|       *prp = rp;
#  144|->     rp->testname = testname;
#  145|       rp->index = -1;  /* increment before each test */
#  146|   

Error: CPPCHECK_WARNING (CWE-476): [#def1775]
leptonica-1.87.0/src/regutils.c:145: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rp
#  143|       *prp = rp;
#  144|       rp->testname = testname;
#  145|->     rp->index = -1;  /* increment before each test */
#  146|   
#  147|           /* Initialize to true.  A failure in any test is registered

Error: CPPCHECK_WARNING (CWE-476): [#def1776]
leptonica-1.87.0/src/regutils.c:149: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rp
#  147|           /* Initialize to true.  A failure in any test is registered
#  148|            * as a failure of the regression test. */
#  149|->     rp->success = TRUE;
#  150|   
#  151|           /* Make sure the lept/regout subdirectory exists */

Error: COMPILER_WARNING (CWE-1164): [#def1777]
leptonica-1.87.0/src/rop.c:541:1: warning[-Wunused-function]: ‘checkRasteropCrop’ defined but not used
#  541 | checkRasteropCrop(l_int32 pixw,
#      | ^~~~~~~~~~~~~~~~~
#  539|    */
#  540|   static l_int32
#  541|-> checkRasteropCrop(l_int32 pixw,
#  542|                     l_int32 pixh,
#  543|                     l_int32 x,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1778]
leptonica-1.87.0/src/roplow.c:2251:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘fwmask’
leptonica-1.87.0/src/roplow.c:2220:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/roplow.c:2223:9: branch_false: ...to here
leptonica-1.87.0/src/roplow.c:2230:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/roplow.c:2247:8: branch_true: ...to here
leptonica-1.87.0/src/roplow.c:2247:8: branch_false: following ‘false’ branch (when ‘w < fwbits’)...
leptonica-1.87.0/src/roplow.c:2251:27: branch_false: ...to here
leptonica-1.87.0/src/roplow.c:2251:9: danger: use of uninitialized value ‘fwmask’ here
# 2249|       } else {  /* if so */
# 2250|           fwpart2b = 1;
# 2251|->         fwmask &= lmask32[32 - fwbits + w];
# 2252|       }
# 2253|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1779]
leptonica-1.87.0/src/rotateorth.c:554:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/rotateorth.c:430:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/rotateorth.c:432:5: branch_false: ...to here
leptonica-1.87.0/src/rotateorth.c:438:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rotateorth.c:441:12: branch_false: ...to here
leptonica-1.87.0/src/rotateorth.c:460:31: acquire_memory: allocated here
leptonica-1.87.0/src/rotateorth.c:460:8: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)...
leptonica-1.87.0/src/rotateorth.c:465:5: branch_false: ...to here
leptonica-1.87.0/src/rotateorth.c:554:13: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/rotateorth.c:554:13: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  552|               break;
#  553|           default:
#  554|->             pixDestroy(&pixd);
#  555|               L_ERROR("illegal depth: %d\n", __func__, d);
#  556|               break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1780]
leptonica-1.87.0/src/rotateorth.c:555:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/rotateorth.c:430:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/rotateorth.c:432:5: branch_false: ...to here
leptonica-1.87.0/src/rotateorth.c:438:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/rotateorth.c:441:12: branch_false: ...to here
leptonica-1.87.0/src/rotateorth.c:460:31: acquire_memory: allocated here
leptonica-1.87.0/src/rotateorth.c:460:8: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)...
leptonica-1.87.0/src/rotateorth.c:465:5: branch_false: ...to here
leptonica-1.87.0/src/rotateorth.c:555:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/rotateorth.c:555:13: branch_true: ...to here
leptonica-1.87.0/src/rotateorth.c:555:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/rotateorth.c:555:13: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  553|           default:
#  554|               pixDestroy(&pixd);
#  555|->             L_ERROR("illegal depth: %d\n", __func__, d);
#  556|               break;
#  557|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1781]
leptonica-1.87.0/src/rotateorth.c:653: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
#  651|       tab = (l_uint8 *)LEPT_CALLOC(256, sizeof(l_uint8));
#  652|       for (i = 0; i < 256; i++)
#  653|->         tab[i] = ((0x80 & i) >> 7) |
#  654|                    ((0x40 & i) >> 5) |
#  655|                    ((0x20 & i) >> 3) |

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1782]
leptonica-1.87.0/src/rotateorth.c:653:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/rotateorth.c:651:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/rotateorth.c:652:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/rotateorth.c:653:18: branch_true: ...to here
leptonica-1.87.0/src/rotateorth.c:653:9: danger: ‘tab + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  651|       tab = (l_uint8 *)LEPT_CALLOC(256, sizeof(l_uint8));
#  652|       for (i = 0; i < 256; i++)
#  653|->         tab[i] = ((0x80 & i) >> 7) |
#  654|                    ((0x40 & i) >> 5) |
#  655|                    ((0x20 & i) >> 3) |

Error: CPPCHECK_WARNING (CWE-476): [#def1783]
leptonica-1.87.0/src/rotateorth.c:680: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
#  678|       tab = (l_uint8 *)LEPT_CALLOC(256, sizeof(l_uint8));
#  679|       for (i = 0; i < 256; i++)
#  680|->         tab[i] = ((0xc0 & i) >> 6) |
#  681|                    ((0x30 & i) >> 2) |
#  682|                    ((0x0c & i) << 2) |

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1784]
leptonica-1.87.0/src/rotateorth.c:680:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/rotateorth.c:678:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/rotateorth.c:679:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/rotateorth.c:680:18: branch_true: ...to here
leptonica-1.87.0/src/rotateorth.c:680:9: danger: ‘tab + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  678|       tab = (l_uint8 *)LEPT_CALLOC(256, sizeof(l_uint8));
#  679|       for (i = 0; i < 256; i++)
#  680|->         tab[i] = ((0xc0 & i) >> 6) |
#  681|                    ((0x30 & i) >> 2) |
#  682|                    ((0x0c & i) << 2) |

Error: CPPCHECK_WARNING (CWE-476): [#def1785]
leptonica-1.87.0/src/rotateorth.c:703: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
#  701|       tab = (l_uint8 *)LEPT_CALLOC(256, sizeof(l_uint8));
#  702|       for (i = 0; i < 256; i++)
#  703|->         tab[i] = ((0xf0 & i) >> 4) | ((0x0f & i) << 4);
#  704|       return tab;
#  705|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1786]
leptonica-1.87.0/src/rotateorth.c:703:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/rotateorth.c:701:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/rotateorth.c:702:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/rotateorth.c:703:18: branch_true: ...to here
leptonica-1.87.0/src/rotateorth.c:703:9: danger: ‘tab + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  701|       tab = (l_uint8 *)LEPT_CALLOC(256, sizeof(l_uint8));
#  702|       for (i = 0; i < 256; i++)
#  703|->         tab[i] = ((0xf0 & i) >> 4) | ((0x0f & i) << 4);
#  704|       return tab;
#  705|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1787]
leptonica-1.87.0/src/runlength.c:302:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:301:8: branch_true: following ‘true’ branch (when ‘color == 0’)...
leptonica-1.87.0/src/runlength.c:302:16: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:302:16: throw: if ‘pixInvert’ throws an exception...
leptonica-1.87.0/src/runlength.c:302:16: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  300|           /* Use fg runs for evaluation */
#  301|       if (color == 0)
#  302|->         pixt = pixInvert(NULL, pixs);
#  303|       else
#  304|           pixt = pixClone(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1788]
leptonica-1.87.0/src/runlength.c:302:16: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:301:8: branch_true: following ‘true’ branch (when ‘color == 0’)...
leptonica-1.87.0/src/runlength.c:302:16: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:302:16: throw: if ‘pixInvert’ throws an exception...
leptonica-1.87.0/src/runlength.c:302:16: danger: ‘end’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  300|           /* Use fg runs for evaluation */
#  301|       if (color == 0)
#  302|->         pixt = pixInvert(NULL, pixs);
#  303|       else
#  304|           pixt = pixClone(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1789]
leptonica-1.87.0/src/runlength.c:302:16: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:301:8: branch_true: following ‘true’ branch (when ‘color == 0’)...
leptonica-1.87.0/src/runlength.c:302:16: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:302:16: throw: if ‘pixInvert’ throws an exception...
leptonica-1.87.0/src/runlength.c:302:16: danger: ‘start’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  300|           /* Use fg runs for evaluation */
#  301|       if (color == 0)
#  302|->         pixt = pixInvert(NULL, pixs);
#  303|       else
#  304|           pixt = pixClone(pixs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1790]
leptonica-1.87.0/src/runlength.c:304:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:301:8: branch_false: following ‘false’ branch (when ‘color != 0’)...
leptonica-1.87.0/src/runlength.c:304:16: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:304:16: throw: if ‘pixClone’ throws an exception...
leptonica-1.87.0/src/runlength.c:304:16: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#  302|           pixt = pixInvert(NULL, pixs);
#  303|       else
#  304|->         pixt = pixClone(pixs);
#  305|   
#  306|       if (direction == L_HORIZONTAL_RUNS) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1791]
leptonica-1.87.0/src/runlength.c:304:16: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:301:8: branch_false: following ‘false’ branch (when ‘color != 0’)...
leptonica-1.87.0/src/runlength.c:304:16: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:304:16: throw: if ‘pixClone’ throws an exception...
leptonica-1.87.0/src/runlength.c:304:16: danger: ‘end’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  302|           pixt = pixInvert(NULL, pixs);
#  303|       else
#  304|->         pixt = pixClone(pixs);
#  305|   
#  306|       if (direction == L_HORIZONTAL_RUNS) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1792]
leptonica-1.87.0/src/runlength.c:304:16: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:301:8: branch_false: following ‘false’ branch (when ‘color != 0’)...
leptonica-1.87.0/src/runlength.c:304:16: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:304:16: throw: if ‘pixClone’ throws an exception...
leptonica-1.87.0/src/runlength.c:304:16: danger: ‘start’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#  302|           pixt = pixInvert(NULL, pixs);
#  303|       else
#  304|->         pixt = pixClone(pixs);
#  305|   
#  306|       if (direction == L_HORIZONTAL_RUNS) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1793]
leptonica-1.87.0/src/runlength.c:337:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:307:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:337:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:337:5: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/runlength.c:337:5: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
#  335|       }
#  336|   
#  337|->     pixDestroy(&pixt);
#  338|       LEPT_FREE(start);
#  339|       LEPT_FREE(end);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1794]
leptonica-1.87.0/src/runlength.c:337:5: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:307:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:337:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:337:5: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/runlength.c:337:5: danger: ‘end’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#  335|       }
#  336|   
#  337|->     pixDestroy(&pixt);
#  338|       LEPT_FREE(start);
#  339|       LEPT_FREE(end);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1795]
leptonica-1.87.0/src/runlength.c:337:5: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:307:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:337:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:337:5: throw: if ‘pixDestroy’ throws an exception...
leptonica-1.87.0/src/runlength.c:337:5: danger: ‘start’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
#  335|       }
#  336|   
#  337|->     pixDestroy(&pixt);
#  338|       LEPT_FREE(start);
#  339|       LEPT_FREE(end);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1796]
leptonica-1.87.0/src/runlength.c:383:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  381|       *pn = 0;
#  382|       if (!pix)
#  383|->         return ERROR_INT("pix not defined", __func__, 1);
#  384|       pixGetDimensions(pix, &w, &h, &d);
#  385|       if (d != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1797]
leptonica-1.87.0/src/runlength.c:383:16: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  381|       *pn = 0;
#  382|       if (!pix)
#  383|->         return ERROR_INT("pix not defined", __func__, 1);
#  384|       pixGetDimensions(pix, &w, &h, &d);
#  385|       if (d != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1798]
leptonica-1.87.0/src/runlength.c:383:16: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  381|       *pn = 0;
#  382|       if (!pix)
#  383|->         return ERROR_INT("pix not defined", __func__, 1);
#  384|       pixGetDimensions(pix, &w, &h, &d);
#  385|       if (d != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1799]
leptonica-1.87.0/src/runlength.c:384:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  382|       if (!pix)
#  383|           return ERROR_INT("pix not defined", __func__, 1);
#  384|->     pixGetDimensions(pix, &w, &h, &d);
#  385|       if (d != 1)
#  386|           return ERROR_INT("pix not 1 bpp", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1800]
leptonica-1.87.0/src/runlength.c:384:5: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  382|       if (!pix)
#  383|           return ERROR_INT("pix not defined", __func__, 1);
#  384|->     pixGetDimensions(pix, &w, &h, &d);
#  385|       if (d != 1)
#  386|           return ERROR_INT("pix not 1 bpp", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1801]
leptonica-1.87.0/src/runlength.c:384:5: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  382|       if (!pix)
#  383|           return ERROR_INT("pix not defined", __func__, 1);
#  384|->     pixGetDimensions(pix, &w, &h, &d);
#  385|       if (d != 1)
#  386|           return ERROR_INT("pix not 1 bpp", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1802]
leptonica-1.87.0/src/runlength.c:386:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  384|       pixGetDimensions(pix, &w, &h, &d);
#  385|       if (d != 1)
#  386|->         return ERROR_INT("pix not 1 bpp", __func__, 1);
#  387|       if (y < 0 || y >= h)
#  388|           return ERROR_INT("y not in [0 ... h - 1]", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1803]
leptonica-1.87.0/src/runlength.c:386:16: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  384|       pixGetDimensions(pix, &w, &h, &d);
#  385|       if (d != 1)
#  386|->         return ERROR_INT("pix not 1 bpp", __func__, 1);
#  387|       if (y < 0 || y >= h)
#  388|           return ERROR_INT("y not in [0 ... h - 1]", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1804]
leptonica-1.87.0/src/runlength.c:386:16: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  384|       pixGetDimensions(pix, &w, &h, &d);
#  385|       if (d != 1)
#  386|->         return ERROR_INT("pix not 1 bpp", __func__, 1);
#  387|       if (y < 0 || y >= h)
#  388|           return ERROR_INT("y not in [0 ... h - 1]", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1805]
leptonica-1.87.0/src/runlength.c:388:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  386|           return ERROR_INT("pix not 1 bpp", __func__, 1);
#  387|       if (y < 0 || y >= h)
#  388|->         return ERROR_INT("y not in [0 ... h - 1]", __func__, 1);
#  389|       if (!xstart)
#  390|           return ERROR_INT("xstart not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1806]
leptonica-1.87.0/src/runlength.c:388:16: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  386|           return ERROR_INT("pix not 1 bpp", __func__, 1);
#  387|       if (y < 0 || y >= h)
#  388|->         return ERROR_INT("y not in [0 ... h - 1]", __func__, 1);
#  389|       if (!xstart)
#  390|           return ERROR_INT("xstart not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1807]
leptonica-1.87.0/src/runlength.c:388:16: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  386|           return ERROR_INT("pix not 1 bpp", __func__, 1);
#  387|       if (y < 0 || y >= h)
#  388|->         return ERROR_INT("y not in [0 ... h - 1]", __func__, 1);
#  389|       if (!xstart)
#  390|           return ERROR_INT("xstart not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1808]
leptonica-1.87.0/src/runlength.c:390:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  388|           return ERROR_INT("y not in [0 ... h - 1]", __func__, 1);
#  389|       if (!xstart)
#  390|->         return ERROR_INT("xstart not defined", __func__, 1);
#  391|       if (!xend)
#  392|           return ERROR_INT("xend not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1809]
leptonica-1.87.0/src/runlength.c:390:16: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  388|           return ERROR_INT("y not in [0 ... h - 1]", __func__, 1);
#  389|       if (!xstart)
#  390|->         return ERROR_INT("xstart not defined", __func__, 1);
#  391|       if (!xend)
#  392|           return ERROR_INT("xend not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1810]
leptonica-1.87.0/src/runlength.c:392:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  390|           return ERROR_INT("xstart not defined", __func__, 1);
#  391|       if (!xend)
#  392|->         return ERROR_INT("xend not defined", __func__, 1);
#  393|   
#  394|       wpl = pixGetWpl(pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1811]
leptonica-1.87.0/src/runlength.c:392:16: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  390|           return ERROR_INT("xstart not defined", __func__, 1);
#  391|       if (!xend)
#  392|->         return ERROR_INT("xend not defined", __func__, 1);
#  393|   
#  394|       wpl = pixGetWpl(pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1812]
leptonica-1.87.0/src/runlength.c:394:11: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  392|           return ERROR_INT("xend not defined", __func__, 1);
#  393|   
#  394|->     wpl = pixGetWpl(pix);
#  395|       line = pixGetData(pix) + y * wpl;
#  396|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1813]
leptonica-1.87.0/src/runlength.c:394:11: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  392|           return ERROR_INT("xend not defined", __func__, 1);
#  393|   
#  394|->     wpl = pixGetWpl(pix);
#  395|       line = pixGetData(pix) + y * wpl;
#  396|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1814]
leptonica-1.87.0/src/runlength.c:394:11: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  392|           return ERROR_INT("xend not defined", __func__, 1);
#  393|   
#  394|->     wpl = pixGetWpl(pix);
#  395|       line = pixGetData(pix) + y * wpl;
#  396|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1815]
leptonica-1.87.0/src/runlength.c:395:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  393|   
#  394|       wpl = pixGetWpl(pix);
#  395|->     line = pixGetData(pix) + y * wpl;
#  396|   
#  397|       inrun = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1816]
leptonica-1.87.0/src/runlength.c:395:12: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  393|   
#  394|       wpl = pixGetWpl(pix);
#  395|->     line = pixGetData(pix) + y * wpl;
#  396|   
#  397|       inrun = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1817]
leptonica-1.87.0/src/runlength.c:395:12: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_true: following ‘true’ branch (when ‘direction == 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:307:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:308:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:308:13: call_function: calling ‘pixFindHorizontalRuns’ from ‘pixRunlengthTransform’
#  393|   
#  394|       wpl = pixGetWpl(pix);
#  395|->     line = pixGetData(pix) + y * wpl;
#  396|   
#  397|       inrun = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1818]
leptonica-1.87.0/src/runlength.c:458:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  456|       *pn = 0;
#  457|       if (!pix)
#  458|->         return ERROR_INT("pix not defined", __func__, 1);
#  459|       pixGetDimensions(pix, &w, &h, &d);
#  460|       if (d != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1819]
leptonica-1.87.0/src/runlength.c:458:16: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  456|       *pn = 0;
#  457|       if (!pix)
#  458|->         return ERROR_INT("pix not defined", __func__, 1);
#  459|       pixGetDimensions(pix, &w, &h, &d);
#  460|       if (d != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1820]
leptonica-1.87.0/src/runlength.c:458:16: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  456|       *pn = 0;
#  457|       if (!pix)
#  458|->         return ERROR_INT("pix not defined", __func__, 1);
#  459|       pixGetDimensions(pix, &w, &h, &d);
#  460|       if (d != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1821]
leptonica-1.87.0/src/runlength.c:459:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  457|       if (!pix)
#  458|           return ERROR_INT("pix not defined", __func__, 1);
#  459|->     pixGetDimensions(pix, &w, &h, &d);
#  460|       if (d != 1)
#  461|           return ERROR_INT("pix not 1 bpp", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1822]
leptonica-1.87.0/src/runlength.c:459:5: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  457|       if (!pix)
#  458|           return ERROR_INT("pix not defined", __func__, 1);
#  459|->     pixGetDimensions(pix, &w, &h, &d);
#  460|       if (d != 1)
#  461|           return ERROR_INT("pix not 1 bpp", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1823]
leptonica-1.87.0/src/runlength.c:459:5: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  457|       if (!pix)
#  458|           return ERROR_INT("pix not defined", __func__, 1);
#  459|->     pixGetDimensions(pix, &w, &h, &d);
#  460|       if (d != 1)
#  461|           return ERROR_INT("pix not 1 bpp", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1824]
leptonica-1.87.0/src/runlength.c:461:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  459|       pixGetDimensions(pix, &w, &h, &d);
#  460|       if (d != 1)
#  461|->         return ERROR_INT("pix not 1 bpp", __func__, 1);
#  462|       if (x < 0 || x >= w)
#  463|           return ERROR_INT("x not in [0 ... w - 1]", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1825]
leptonica-1.87.0/src/runlength.c:461:16: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  459|       pixGetDimensions(pix, &w, &h, &d);
#  460|       if (d != 1)
#  461|->         return ERROR_INT("pix not 1 bpp", __func__, 1);
#  462|       if (x < 0 || x >= w)
#  463|           return ERROR_INT("x not in [0 ... w - 1]", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1826]
leptonica-1.87.0/src/runlength.c:461:16: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  459|       pixGetDimensions(pix, &w, &h, &d);
#  460|       if (d != 1)
#  461|->         return ERROR_INT("pix not 1 bpp", __func__, 1);
#  462|       if (x < 0 || x >= w)
#  463|           return ERROR_INT("x not in [0 ... w - 1]", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1827]
leptonica-1.87.0/src/runlength.c:463:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  461|           return ERROR_INT("pix not 1 bpp", __func__, 1);
#  462|       if (x < 0 || x >= w)
#  463|->         return ERROR_INT("x not in [0 ... w - 1]", __func__, 1);
#  464|       if (!ystart)
#  465|           return ERROR_INT("ystart not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1828]
leptonica-1.87.0/src/runlength.c:463:16: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  461|           return ERROR_INT("pix not 1 bpp", __func__, 1);
#  462|       if (x < 0 || x >= w)
#  463|->         return ERROR_INT("x not in [0 ... w - 1]", __func__, 1);
#  464|       if (!ystart)
#  465|           return ERROR_INT("ystart not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1829]
leptonica-1.87.0/src/runlength.c:463:16: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  461|           return ERROR_INT("pix not 1 bpp", __func__, 1);
#  462|       if (x < 0 || x >= w)
#  463|->         return ERROR_INT("x not in [0 ... w - 1]", __func__, 1);
#  464|       if (!ystart)
#  465|           return ERROR_INT("ystart not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1830]
leptonica-1.87.0/src/runlength.c:465:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  463|           return ERROR_INT("x not in [0 ... w - 1]", __func__, 1);
#  464|       if (!ystart)
#  465|->         return ERROR_INT("ystart not defined", __func__, 1);
#  466|       if (!yend)
#  467|           return ERROR_INT("yend not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1831]
leptonica-1.87.0/src/runlength.c:465:16: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  463|           return ERROR_INT("x not in [0 ... w - 1]", __func__, 1);
#  464|       if (!ystart)
#  465|->         return ERROR_INT("ystart not defined", __func__, 1);
#  466|       if (!yend)
#  467|           return ERROR_INT("yend not defined", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1832]
leptonica-1.87.0/src/runlength.c:467:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  465|           return ERROR_INT("ystart not defined", __func__, 1);
#  466|       if (!yend)
#  467|->         return ERROR_INT("yend not defined", __func__, 1);
#  468|   
#  469|       wpl = pixGetWpl(pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1833]
leptonica-1.87.0/src/runlength.c:467:16: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  465|           return ERROR_INT("ystart not defined", __func__, 1);
#  466|       if (!yend)
#  467|->         return ERROR_INT("yend not defined", __func__, 1);
#  468|   
#  469|       wpl = pixGetWpl(pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1834]
leptonica-1.87.0/src/runlength.c:469:11: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  467|           return ERROR_INT("yend not defined", __func__, 1);
#  468|   
#  469|->     wpl = pixGetWpl(pix);
#  470|       data = pixGetData(pix);
#  471|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1835]
leptonica-1.87.0/src/runlength.c:469:11: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  467|           return ERROR_INT("yend not defined", __func__, 1);
#  468|   
#  469|->     wpl = pixGetWpl(pix);
#  470|       data = pixGetData(pix);
#  471|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1836]
leptonica-1.87.0/src/runlength.c:469:11: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  467|           return ERROR_INT("yend not defined", __func__, 1);
#  468|   
#  469|->     wpl = pixGetWpl(pix);
#  470|       data = pixGetData(pix);
#  471|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1837]
leptonica-1.87.0/src/runlength.c:470:12: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:298:25: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  468|   
#  469|       wpl = pixGetWpl(pix);
#  470|->     data = pixGetData(pix);
#  471|   
#  472|       inrun = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1838]
leptonica-1.87.0/src/runlength.c:470:12: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:297:22: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  468|   
#  469|       wpl = pixGetWpl(pix);
#  470|->     data = pixGetData(pix);
#  471|   
#  472|       inrun = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1839]
leptonica-1.87.0/src/runlength.c:470:12: warning[-Wanalyzer-malloc-leak]: leak of ‘start’
leptonica-1.87.0/src/runlength.c:261:1: enter_function: entry to ‘pixRunlengthTransform’
leptonica-1.87.0/src/runlength.c:273:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:275:9: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:275:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:278:5: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:281:13: branch_true: following ‘true’ branch (when ‘direction == 1’)...
leptonica-1.87.0/src/runlength.c:282:23: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:286:8: branch_false: following ‘false’ branch (when ‘bufsize <= 1000000’)...
leptonica-1.87.0/src/runlength.c:291:17: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:291:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/runlength.c:293:13: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:296:24: acquire_memory: allocated here
leptonica-1.87.0/src/runlength.c:306:8: branch_false: following ‘false’ branch (when ‘direction != 0’)...
leptonica-1.87.0/src/runlength.c:306:8: branch_false: ...to here
leptonica-1.87.0/src/runlength.c:320:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/runlength.c:321:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:321:13: call_function: calling ‘pixFindVerticalRuns’ from ‘pixRunlengthTransform’
#  468|   
#  469|       wpl = pixGetWpl(pix);
#  470|->     data = pixGetData(pix);
#  471|   
#  472|       inrun = FALSE;

Error: CPPCHECK_WARNING (CWE-476): [#def1840]
leptonica-1.87.0/src/runlength.c:785: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
#  783|           if (bitval == 0)
#  784|               byte = ~byte;
#  785|->         tab[i] = 8;
#  786|           mask = 0x80;
#  787|           for (j = 0; j < 8; j++) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1841]
leptonica-1.87.0/src/runlength.c:785:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/runlength.c:780:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/runlength.c:781:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/runlength.c:782:9: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:783:12: branch_true: following ‘true’ branch (when ‘bitval == 0’)...
leptonica-1.87.0/src/runlength.c:784:13: branch_true: ...to here
leptonica-1.87.0/src/runlength.c:785:9: danger: ‘tab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/0)
#  783|           if (bitval == 0)
#  784|               byte = ~byte;
#  785|->         tab[i] = 8;
#  786|           mask = 0x80;
#  787|           for (j = 0; j < 8; j++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1842]
leptonica-1.87.0/src/sarray1.c:173:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(realdir)’
leptonica-1.87.0/src/sarray1.c:1881:1: enter_function: entry to ‘getFilenamesInDirectory’
leptonica-1.87.0/src/sarray1.c:1891:8: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/sarray1.c:1893:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1893:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1906:14: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1909:8: branch_false: following ‘false’ branch (when ‘realdir’ is non-NULL)...
leptonica-1.87.0/src/sarray1.c:1911:17: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1911:17: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1911:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1916:15: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1916:15: call_function: calling ‘sarrayCreate’ from ‘getFilenamesInDirectory’
#  171|   SARRAY  *sa;
#  172|   
#  173|->     if (n <= 0 || n > (l_int32)MaxPtrArraySize)
#  174|           n = InitialPtrArraySize;
#  175|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1843]
leptonica-1.87.0/src/sarray1.c:173:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sarrayCreate(0)’
leptonica-1.87.0/src/sarray1.c:1881:1: enter_function: entry to ‘getFilenamesInDirectory’
leptonica-1.87.0/src/sarray1.c:1891:8: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/sarray1.c:1893:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1893:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1906:14: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1909:8: branch_false: following ‘false’ branch (when ‘realdir’ is non-NULL)...
leptonica-1.87.0/src/sarray1.c:1911:17: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1911:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1916:15: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1916:15: call_function: calling ‘sarrayCreate’ from ‘getFilenamesInDirectory’
leptonica-1.87.0/src/sarray1.c:1916:15: return_function: returning to ‘getFilenamesInDirectory’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1917:25: throw: if ‘readdir’ throws an exception...
leptonica-1.87.0/src/sarray1.c:173:9: danger: ‘sarrayCreate(0)’ leaks here; was allocated at [(14)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/13)
#  171|   SARRAY  *sa;
#  172|   
#  173|->     if (n <= 0 || n > (l_int32)MaxPtrArraySize)
#  174|           n = InitialPtrArraySize;
#  175|   

Error: CPPCHECK_WARNING (CWE-476): [#def1844]
leptonica-1.87.0/src/sarray1.c:177: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sa
#  175|   
#  176|       sa = (SARRAY *)LEPT_CALLOC(1, sizeof(SARRAY));
#  177|->     if ((sa->array = (char **)LEPT_CALLOC(n, sizeof(char *))) == NULL) {
#  178|           sarrayDestroy(&sa);
#  179|           return (SARRAY *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1845]
leptonica-1.87.0/src/sarray1.c:177:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sa’
leptonica-1.87.0/src/sarray1.c:386:1: enter_function: entry to ‘sarrayCopy’
leptonica-1.87.0/src/sarray1.c:394:16: call_function: calling ‘sarrayCreate’ from ‘sarrayCopy’
#  175|   
#  176|       sa = (SARRAY *)LEPT_CALLOC(1, sizeof(SARRAY));
#  177|->     if ((sa->array = (char **)LEPT_CALLOC(n, sizeof(char *))) == NULL) {
#  178|           sarrayDestroy(&sa);
#  179|           return (SARRAY *)ERROR_PTR("ptr array not made", __func__, NULL);

Error: CPPCHECK_WARNING (CWE-476): [#def1846]
leptonica-1.87.0/src/sarray1.c:182: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sa
#  180|       }
#  181|   
#  182|->     sa->nalloc = n;
#  183|       sa->n = 0;
#  184|       sa->refcount = 1;

Error: CPPCHECK_WARNING (CWE-476): [#def1847]
leptonica-1.87.0/src/sarray1.c:183: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sa
#  181|   
#  182|       sa->nalloc = n;
#  183|->     sa->n = 0;
#  184|       sa->refcount = 1;
#  185|       return sa;

Error: CPPCHECK_WARNING (CWE-476): [#def1848]
leptonica-1.87.0/src/sarray1.c:184: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sa
#  182|       sa->nalloc = n;
#  183|       sa->n = 0;
#  184|->     sa->refcount = 1;
#  185|       return sa;
#  186|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1849]
leptonica-1.87.0/src/sarray1.c:376:1: warning[-Wanalyzer-malloc-leak]: leak of ‘sa’
leptonica-1.87.0/src/sarray1.c:386:1: enter_function: entry to ‘sarrayCopy’
leptonica-1.87.0/src/sarray1.c:394:16: call_function: calling ‘sarrayCreate’ from ‘sarrayCopy’
#  374|       }
#  375|       *psa = NULL;
#  376|-> }
#  377|   
#  378|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1850]
leptonica-1.87.0/src/sarray1.c:451:20: warning[-Wanalyzer-malloc-leak]: leak of ‘stringbuf’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1412:25: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1416:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1422:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1423:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1425:33: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1428:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1428:12: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1436:9: call_function: calling ‘sarrayAddString’ from ‘sarrayReadStream’
#  449|       if (n >= sa->nalloc) {
#  450|           if (sarrayExtendArray(sa))
#  451|->             return ERROR_INT("extension failed", __func__, 1);
#  452|       }
#  453|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1851]
leptonica-1.87.0/src/sarray1.c:455:24: warning[-Wanalyzer-malloc-leak]: leak of ‘stringbuf’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1412:25: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1416:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1422:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1423:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1425:33: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1428:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1428:12: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1436:9: call_function: calling ‘sarrayAddString’ from ‘sarrayReadStream’
#  453|   
#  454|       if (copyflag == L_COPY)
#  455|->         sa->array[n] = stringNew(string);
#  456|       else  /* L_INSERT or L_NOCOPY */
#  457|           sa->array[n] = (char *)string;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1852]
leptonica-1.87.0/src/sarray1.c:483:16: warning[-Wanalyzer-malloc-leak]: leak of ‘stringbuf’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1412:25: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1416:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1422:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1423:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1425:33: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1428:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1428:12: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1436:9: call_function: calling ‘sarrayAddString’ from ‘sarrayReadStream’
#  481|           return ERROR_INT("sa not defined", __func__, 1);
#  482|       if (sa->nalloc >= (l_int32)MaxPtrArraySize)  /* belt & suspenders */
#  483|->         return ERROR_INT("sa at maximum ptr size; can't extend", __func__, 1);
#  484|       oldsize = sa->nalloc * sizeof(char *);
#  485|       if (sa->nalloc > (l_int32)(MaxPtrArraySize / 2)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1853]
leptonica-1.87.0/src/sarray1.c:492:31: warning[-Wanalyzer-malloc-leak]: leak of ‘stringbuf’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1412:25: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1416:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1422:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1423:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1425:33: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1428:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1428:12: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1436:9: call_function: calling ‘sarrayAddString’ from ‘sarrayReadStream’
#  490|           sa->nalloc *= 2;
#  491|       }
#  492|->     if ((sa->array = (char **)reallocNew((void **)&sa->array,
#  493|                                            oldsize, newsize)) == NULL)
#  494|           return ERROR_INT("new ptr array not returned", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1854]
leptonica-1.87.0/src/sarray1.c:494:16: warning[-Wanalyzer-malloc-leak]: leak of ‘stringbuf’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1412:25: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1416:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1422:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1423:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1425:33: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1428:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1428:12: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1436:9: call_function: calling ‘sarrayAddString’ from ‘sarrayReadStream’
#  492|       if ((sa->array = (char **)reallocNew((void **)&sa->array,
#  493|                                            oldsize, newsize)) == NULL)
#  494|->         return ERROR_INT("new ptr array not returned", __func__, 1);
#  495|   
#  496|       return 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1855]
leptonica-1.87.0/src/sarray1.c:1173:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
leptonica-1.87.0/src/sarray1.c:1156:1: enter_function: entry to ‘sarraySelectBySubstring’
leptonica-1.87.0/src/sarray1.c:1167:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1170:13: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1170:13: call_function: calling ‘sarrayCreate’ from ‘sarraySelectBySubstring’
leptonica-1.87.0/src/sarray1.c:1170:13: return_function: returning to ‘sarraySelectBySubstring’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1171:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1172:15: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1172:15: call_function: calling ‘sarrayGetString’ from ‘sarraySelectBySubstring’
leptonica-1.87.0/src/sarray1.c:1172:15: return_function: returning to ‘sarraySelectBySubstring’ from ‘sarrayGetString’
leptonica-1.87.0/src/sarray1.c:1173:9: danger: argument 1 (‘sarrayGetString(sain,  i, 0)’) NULL where non-null expected
# 1171|       for (i = 0; i < n; i++) {
# 1172|           str = sarrayGetString(sain, i, L_NOCOPY);
# 1173|->         arrayFindSequence((l_uint8 *)str, strlen(str), (l_uint8 *)substr,
# 1174|                             strlen(substr), &offset, &found);
# 1175|           if (found)

Error: COMPILER_WARNING: [#def1856]
leptonica-1.87.0/src/sarray1.c: scope_hint: In function ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1390:47: warning[-Wunused-but-set-variable=]: variable ‘ignore’ set but not used
# 1390 | l_int32  i, n, size, index, bufsize, version, ignore, success;
#      |                                               ^~~~~~
# 1388|   {
# 1389|   char    *stringbuf;
# 1390|-> l_int32  i, n, size, index, bufsize, version, ignore, success;
# 1391|   SARRAY  *sa;
# 1392|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1857]
leptonica-1.87.0/src/sarray1.c:1418:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1418:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1418:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1418:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/sarray1.c:1418:13: danger: ‘<unknown>’ leaks here; was allocated at [(14)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/13)
# 1416|           if ((fscanf(fp, "%d[%d]:", &index, &size) != 2) || (size > (1 << 30))) {
# 1417|               success = FALSE;
# 1418|->             L_ERROR("error on string size\n", __func__);
# 1419|               goto cleanup;
# 1420|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1858]
leptonica-1.87.0/src/sarray1.c:1418:13: warning[-Wanalyzer-malloc-leak]: leak of ‘sa’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1418:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1418:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1418:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/sarray1.c:1418:13: danger: ‘sa’ leaks here; was allocated at [(14)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/13)
# 1416|           if ((fscanf(fp, "%d[%d]:", &index, &size) != 2) || (size > (1 << 30))) {
# 1417|               success = FALSE;
# 1418|->             L_ERROR("error on string size\n", __func__);
# 1419|               goto cleanup;
# 1420|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1859]
leptonica-1.87.0/src/sarray1.c:1418:13: warning[-Wanalyzer-malloc-leak]: leak of ‘stringbuf’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1412:25: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1418:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1418:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1418:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/sarray1.c:1418:13: danger: ‘stringbuf’ leaks here; was allocated at [(19)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/18)
# 1416|           if ((fscanf(fp, "%d[%d]:", &index, &size) != 2) || (size > (1 << 30))) {
# 1417|               success = FALSE;
# 1418|->             L_ERROR("error on string size\n", __func__);
# 1419|               goto cleanup;
# 1420|           }

Error: GCC_ANALYZER_WARNING: [#def1860]
leptonica-1.87.0/src/sarray1.c:1425:33: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1416:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1422:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1423:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1425:33: danger: operand ‘1.5e+0’ is of type ‘double’
# 1423|               LEPT_FREE(stringbuf);
# 1424|               bufsize = (l_int32)(1.5 * size);
# 1425|->             stringbuf = (char *)LEPT_CALLOC(bufsize, sizeof(char));
# 1426|           }
# 1427|               /* Read the stored string, plus leading spaces and trailing \n */

Error: CPPCHECK_WARNING (CWE-476): [#def1861]
leptonica-1.87.0/src/sarray1.c:1428: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: stringbuf
# 1426|           }
# 1427|               /* Read the stored string, plus leading spaces and trailing \n */
# 1428|->         if (fread(stringbuf, 1, size + 3, fp) != size + 3) {
# 1429|               success = FALSE;
# 1430|               L_ERROR("error reading string\n", __func__);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1862]
leptonica-1.87.0/src/sarray1.c:1430:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1416:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1422:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1428:33: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1428:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1430:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1430:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1430:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1430:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/sarray1.c:1430:13: danger: ‘<unknown>’ leaks here; was allocated at [(14)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/13)
# 1428|           if (fread(stringbuf, 1, size + 3, fp) != size + 3) {
# 1429|               success = FALSE;
# 1430|->             L_ERROR("error reading string\n", __func__);
# 1431|               goto cleanup;
# 1432|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1863]
leptonica-1.87.0/src/sarray1.c:1430:13: warning[-Wanalyzer-malloc-leak]: leak of ‘sa’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1416:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1422:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1428:33: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1428:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1430:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1430:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1430:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1430:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/sarray1.c:1430:13: danger: ‘sa’ leaks here; was allocated at [(14)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/13)
# 1428|           if (fread(stringbuf, 1, size + 3, fp) != size + 3) {
# 1429|               success = FALSE;
# 1430|->             L_ERROR("error reading string\n", __func__);
# 1431|               goto cleanup;
# 1432|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1864]
leptonica-1.87.0/src/sarray1.c:1430:13: warning[-Wanalyzer-malloc-leak]: leak of ‘stringbuf’
leptonica-1.87.0/src/sarray1.c:1387:1: enter_function: entry to ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1396:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1398:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1398:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1400:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1400:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1402:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1402:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1404:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1406:8: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1409:15: call_function: calling ‘sarrayCreate’ from ‘sarrayReadStream’
leptonica-1.87.0/src/sarray1.c:1409:15: return_function: returning to ‘sarrayReadStream’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1409:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1412:25: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1412:25: acquire_memory: allocated here
leptonica-1.87.0/src/sarray1.c:1414:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1416:14: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1416:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1422:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1428:33: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1428:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1430:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1430:13: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sarray1.c:1430:13: branch_true: ...to here
leptonica-1.87.0/src/sarray1.c:1430:13: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/sarray1.c:1430:13: danger: ‘stringbuf’ leaks here; was allocated at [(19)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/18)
# 1428|           if (fread(stringbuf, 1, size + 3, fp) != size + 3) {
# 1429|               success = FALSE;
# 1430|->             L_ERROR("error reading string\n", __func__);
# 1431|               goto cleanup;
# 1432|           }

Error: COMPILER_WARNING (CWE-563): [#def1865]
leptonica-1.87.0/src/sarray1.c: scope_hint: In function ‘getFilenamesInDirectory’
leptonica-1.87.0/src/sarray1.c:1888:17: warning[-Wunused-variable]: unused variable ‘dfd’
# 1888 | int             dfd, stat_ret;
#      |                 ^~~
# 1886|   DIR            *pdir;
# 1887|   struct dirent  *pdirentry;
# 1888|-> int             dfd, stat_ret;
# 1889|   struct stat     st;
# 1890|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1866]
leptonica-1.87.0/src/sarray1.c:1917:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sarray1.c:1881:1: enter_function: entry to ‘getFilenamesInDirectory’
leptonica-1.87.0/src/sarray1.c:1891:8: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/sarray1.c:1893:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1893:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1906:14: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1909:8: branch_false: following ‘false’ branch (when ‘realdir’ is non-NULL)...
leptonica-1.87.0/src/sarray1.c:1911:17: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1911:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1916:15: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1916:15: call_function: calling ‘sarrayCreate’ from ‘getFilenamesInDirectory’
leptonica-1.87.0/src/sarray1.c:1916:15: return_function: returning to ‘getFilenamesInDirectory’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1917:25: throw: if ‘readdir’ throws an exception...
leptonica-1.87.0/src/sarray1.c:1917:25: danger: ‘<unknown>’ leaks here; was allocated at [(14)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/13)
# 1915|       }
# 1916|       safiles = sarrayCreate(0);
# 1917|->     while ((pdirentry = readdir(pdir))) {
# 1918|   #if HAVE_DIRFD && HAVE_FSTATAT
# 1919|               /* Platform issues: although Linux has these POSIX functions,

Error: CPPCHECK_WARNING (CWE-476): [#def1867]
leptonica-1.87.0/src/sarray1.c:1926: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: stat_path
# 1924|           size = strlen(realdir) + strlen(pdirentry->d_name) + 2;
# 1925|           stat_path = (char *)LEPT_CALLOC(size, 1);
# 1926|->         snprintf(stat_path, size, "%s/%s", realdir, pdirentry->d_name);
# 1927|           stat_ret = stat(stat_path, &st);
# 1928|           LEPT_FREE(stat_path);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1868]
leptonica-1.87.0/src/sarray1.c:1934:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sarray1.c:1881:1: enter_function: entry to ‘getFilenamesInDirectory’
leptonica-1.87.0/src/sarray1.c:1891:8: branch_false: following ‘false’ branch (when ‘dirname’ is non-NULL)...
leptonica-1.87.0/src/sarray1.c:1893:9: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1893:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1906:14: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1909:8: branch_false: following ‘false’ branch (when ‘realdir’ is non-NULL)...
leptonica-1.87.0/src/sarray1.c:1911:17: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1911:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1916:15: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1916:15: call_function: calling ‘sarrayCreate’ from ‘getFilenamesInDirectory’
leptonica-1.87.0/src/sarray1.c:1916:15: return_function: returning to ‘getFilenamesInDirectory’ from ‘sarrayCreate’
leptonica-1.87.0/src/sarray1.c:1917:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sarray1.c:1934:5: branch_false: ...to here
leptonica-1.87.0/src/sarray1.c:1934:5: throw: if ‘closedir’ throws an exception...
leptonica-1.87.0/src/sarray1.c:1934:5: danger: ‘<unknown>’ leaks here; was allocated at [(14)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/13)
# 1932|           sarrayAddString(safiles, pdirentry->d_name, L_COPY);
# 1933|       }
# 1934|->     closedir(pdir);
# 1935|       LEPT_FREE(realdir);
# 1936|       return safiles;

Error: GCC_ANALYZER_WARNING: [#def1869]
leptonica-1.87.0/src/scale1.c:3254:28: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.87.0/src/scale1.c:1910:1: enter_function: entry to ‘pixScaleAreaMap’
leptonica-1.87.0/src/scale1.c:1926:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/scale1.c:1927:9: branch_true: ...to here
leptonica-1.87.0/src/scale1.c:1928:16: call_function: calling ‘pixScaleSmooth’ from ‘pixScaleAreaMap’
# 3252|              src pixels that correspond to dest pixel (j,i).
# 3253|              The are labeled by the arrays srow[i] and scol[j]. */
# 3254|->     if ((srow = (l_int32 *)LEPT_CALLOC(hd, sizeof(l_int32))) == NULL)
# 3255|           return ERROR_INT("srow not made", __func__, 1);
# 3256|       if ((scol = (l_int32 *)LEPT_CALLOC(wd, sizeof(l_int32))) == NULL) {

Error: GCC_ANALYZER_WARNING: [#def1870]
leptonica-1.87.0/src/scale1.c:3256:28: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.87.0/src/scale1.c:1910:1: enter_function: entry to ‘pixScaleAreaMap’
leptonica-1.87.0/src/scale1.c:1926:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/scale1.c:1927:9: branch_true: ...to here
leptonica-1.87.0/src/scale1.c:1928:16: call_function: calling ‘pixScaleSmooth’ from ‘pixScaleAreaMap’
# 3254|       if ((srow = (l_int32 *)LEPT_CALLOC(hd, sizeof(l_int32))) == NULL)
# 3255|           return ERROR_INT("srow not made", __func__, 1);
# 3256|->     if ((scol = (l_int32 *)LEPT_CALLOC(wd, sizeof(l_int32))) == NULL) {
# 3257|           LEPT_FREE(srow);
# 3258|           return ERROR_INT("scol not made", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1871]
leptonica-1.87.0/src/scale1.c:3306:17: warning[-Wanalyzer-malloc-leak]: leak of ‘scol’
leptonica-1.87.0/src/scale1.c:1910:1: enter_function: entry to ‘pixScaleAreaMap’
leptonica-1.87.0/src/scale1.c:1926:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/scale1.c:1927:9: branch_true: ...to here
leptonica-1.87.0/src/scale1.c:1928:16: call_function: calling ‘pixScaleSmooth’ from ‘pixScaleAreaMap’
# 3304|                   gval = (l_int32)((l_float32)gval * norm);
# 3305|                   bval = (l_int32)((l_float32)bval * norm);
# 3306|->                 composeRGBPixel(rval, gval, bval, lined + j);
# 3307|               }
# 3308|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1872]
leptonica-1.87.0/src/scale1.c:3306:17: warning[-Wanalyzer-malloc-leak]: leak of ‘srow’
leptonica-1.87.0/src/scale1.c:1910:1: enter_function: entry to ‘pixScaleAreaMap’
leptonica-1.87.0/src/scale1.c:1926:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/scale1.c:1927:9: branch_true: ...to here
leptonica-1.87.0/src/scale1.c:1928:16: call_function: calling ‘pixScaleSmooth’ from ‘pixScaleAreaMap’
# 3304|                   gval = (l_int32)((l_float32)gval * norm);
# 3305|                   bval = (l_int32)((l_float32)bval * norm);
# 3306|->                 composeRGBPixel(rval, gval, bval, lined + j);
# 3307|               }
# 3308|           }

Error: GCC_ANALYZER_WARNING: [#def1873]
leptonica-1.87.0/src/scale1.c:3751:28: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.87.0/src/scale1.c:1910:1: enter_function: entry to ‘pixScaleAreaMap’
leptonica-1.87.0/src/scale1.c:1926:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/scale1.c:1927:9: branch_true: ...to here
leptonica-1.87.0/src/scale1.c:1928:16: call_function: calling ‘pixScaleSmooth’ from ‘pixScaleAreaMap’
# 3749|           /* The source row corresponding to dest row i ==> srow[i]
# 3750|            * The source col corresponding to dest col j ==> scol[j]  */
# 3751|->     if ((srow = (l_int32 *)LEPT_CALLOC(hd, sizeof(l_int32))) == NULL)
# 3752|           return ERROR_INT("srow not made", __func__, 1);
# 3753|       if ((scol = (l_int32 *)LEPT_CALLOC(wd, sizeof(l_int32))) == NULL) {

Error: GCC_ANALYZER_WARNING: [#def1874]
leptonica-1.87.0/src/scale1.c:3753:28: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.87.0/src/scale1.c:1910:1: enter_function: entry to ‘pixScaleAreaMap’
leptonica-1.87.0/src/scale1.c:1926:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/scale1.c:1927:9: branch_true: ...to here
leptonica-1.87.0/src/scale1.c:1928:16: call_function: calling ‘pixScaleSmooth’ from ‘pixScaleAreaMap’
# 3751|       if ((srow = (l_int32 *)LEPT_CALLOC(hd, sizeof(l_int32))) == NULL)
# 3752|           return ERROR_INT("srow not made", __func__, 1);
# 3753|->     if ((scol = (l_int32 *)LEPT_CALLOC(wd, sizeof(l_int32))) == NULL) {
# 3754|           LEPT_FREE(srow);
# 3755|           return ERROR_INT("scol not made", __func__, 1);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1875]
leptonica-1.87.0/src/scale2.c:1067:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘minval’
leptonica-1.87.0/src/scale2.c:1007:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1011:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1014:9: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1014:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1017:9: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1017:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1020:10: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1030:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1032:5: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1037:17: branch_true: following ‘true’ branch (when ‘hd > i’)...
leptonica-1.87.0/src/scale2.c:1038:25: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1040:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1051:17: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1051:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/scale2.c:1051:16: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1062:16: branch_false: following ‘false’ branch (when ‘type != 1’)...
leptonica-1.87.0/src/scale2.c:1064:21: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1064:21: branch_false: following ‘false’ branch (when ‘type != 2’)...
leptonica-1.87.0/src/scale2.c:1067:17: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1067:17: danger: use of uninitialized value ‘minval’ here
# 1065|                   SET_DATA_BYTE(lined, j, maxval);
# 1066|               else  /* type == L_CHOOSE_MAXDIFF */
# 1067|->                 SET_DATA_BYTE(lined, j, maxval - minval);
# 1068|           }
# 1069|       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1876]
leptonica-1.87.0/src/scale2.c:1157:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘minval’
leptonica-1.87.0/src/scale2.c:1111:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1115:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1117:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1121:5: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1123:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1125:5: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1130:17: branch_true: following ‘true’ branch (when ‘i < hd’)...
leptonica-1.87.0/src/scale2.c:1131:25: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1138:16: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:1145:17: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1145:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/scale2.c:1145:16: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1147:29: branch_true: following ‘true’ branch (when ‘k != 4’)...
leptonica-1.87.0/src/scale2.c:1148:25: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1152:16: branch_false: following ‘false’ branch (when ‘type != 1’)...
leptonica-1.87.0/src/scale2.c:1154:21: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1154:21: branch_false: following ‘false’ branch (when ‘type != 2’)...
leptonica-1.87.0/src/scale2.c:1157:17: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:1157:17: danger: use of uninitialized value ‘minval’ here
# 1155|                   SET_DATA_BYTE(lined, j, maxval);
# 1156|               else  /* type == L_CHOOSE_MAXDIFF */
# 1157|->                 SET_DATA_BYTE(lined, j, maxval - minval);
# 1158|           }
# 1159|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1877]
leptonica-1.87.0/src/scale2.c:1580: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 1578|       tab = (l_uint32 *)LEPT_CALLOC(256, sizeof(l_uint32));
# 1579|       for (i = 0; i < 256; i++) {
# 1580|->         tab[i] = (sum[i & 0x3] | sum[(i >> 2) & 0x3] << 8 |
# 1581|                     sum[(i >> 4) & 0x3] << 16 | sum[(i >> 6) & 0x3] << 24);
# 1582|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1878]
leptonica-1.87.0/src/scale2.c:1580:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/scale2.c:1578:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/scale2.c:1579:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/scale2.c:1580:23: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1580:9: danger: ‘tab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1578|       tab = (l_uint32 *)LEPT_CALLOC(256, sizeof(l_uint32));
# 1579|       for (i = 0; i < 256; i++) {
# 1580|->         tab[i] = (sum[i & 0x3] | sum[(i >> 2) & 0x3] << 8 |
# 1581|                     sum[(i >> 4) & 0x3] << 16 | sum[(i >> 6) & 0x3] << 24);
# 1582|       }

Error: CPPCHECK_WARNING (CWE-476): [#def1879]
leptonica-1.87.0/src/scale2.c:1606: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 1604|       tab = (l_uint8 *)LEPT_CALLOC(5, sizeof(l_uint8));
# 1605|       for (i = 0; i < 5; i++)
# 1606|->         tab[i] = 255 - (i * 255) / 4;
# 1607|       return tab;
# 1608|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1880]
leptonica-1.87.0/src/scale2.c:1606:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/scale2.c:1604:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/scale2.c:1605:17: branch_true: following ‘true’ branch (when ‘i != 5’)...
leptonica-1.87.0/src/scale2.c:1606:24: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1606:9: danger: ‘tab + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1604|       tab = (l_uint8 *)LEPT_CALLOC(5, sizeof(l_uint8));
# 1605|       for (i = 0; i < 5; i++)
# 1606|->         tab[i] = 255 - (i * 255) / 4;
# 1607|       return tab;
# 1608|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1881]
leptonica-1.87.0/src/scale2.c:1735: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 1733|       tab = (l_uint32 *)LEPT_CALLOC(64, sizeof(l_uint32));
# 1734|       for (i = 0; i < 64; i++) {
# 1735|->         tab[i] = (sum[i & 0x07]) | (sum[(i >> 3) & 0x07] << 8);
# 1736|       }
# 1737|       return tab;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1882]
leptonica-1.87.0/src/scale2.c:1735:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/scale2.c:1733:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/scale2.c:1734:17: branch_true: following ‘true’ branch (when ‘i != 64’)...
leptonica-1.87.0/src/scale2.c:1735:23: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1735:9: danger: ‘tab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1733|       tab = (l_uint32 *)LEPT_CALLOC(64, sizeof(l_uint32));
# 1734|       for (i = 0; i < 64; i++) {
# 1735|->         tab[i] = (sum[i & 0x07]) | (sum[(i >> 3) & 0x07] << 8);
# 1736|       }
# 1737|       return tab;

Error: CPPCHECK_WARNING (CWE-476): [#def1883]
leptonica-1.87.0/src/scale2.c:1760: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 1758|       tab = (l_uint8 *)LEPT_CALLOC(10, sizeof(l_uint8));
# 1759|       for (i = 0; i < 10; i++)
# 1760|->         tab[i] = 0xff - (i * 255) / 9;
# 1761|       return tab;
# 1762|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1884]
leptonica-1.87.0/src/scale2.c:1760:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/scale2.c:1758:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/scale2.c:1759:17: branch_true: following ‘true’ branch (when ‘i != 10’)...
leptonica-1.87.0/src/scale2.c:1760:25: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1760:9: danger: ‘tab + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 1758|       tab = (l_uint8 *)LEPT_CALLOC(10, sizeof(l_uint8));
# 1759|       for (i = 0; i < 10; i++)
# 1760|->         tab[i] = 0xff - (i * 255) / 9;
# 1761|       return tab;
# 1762|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1885]
leptonica-1.87.0/src/scale2.c:1852: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 1850|       tab = (l_uint32 *)LEPT_CALLOC(256, sizeof(l_uint32));
# 1851|       for (i = 0; i < 256; i++) {
# 1852|->         tab[i] = (sum[i & 0xf]) | (sum[(i >> 4) & 0xf] << 8);
# 1853|       }
# 1854|       return tab;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1886]
leptonica-1.87.0/src/scale2.c:1852:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/scale2.c:1850:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/scale2.c:1851:17: branch_true: following ‘true’ branch (when ‘i != 256’)...
leptonica-1.87.0/src/scale2.c:1852:23: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1852:9: danger: ‘tab + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1850|       tab = (l_uint32 *)LEPT_CALLOC(256, sizeof(l_uint32));
# 1851|       for (i = 0; i < 256; i++) {
# 1852|->         tab[i] = (sum[i & 0xf]) | (sum[(i >> 4) & 0xf] << 8);
# 1853|       }
# 1854|       return tab;

Error: CPPCHECK_WARNING (CWE-476): [#def1887]
leptonica-1.87.0/src/scale2.c:1877: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 1875|       tab = (l_uint8 *)LEPT_CALLOC(17, sizeof(l_uint8));
# 1876|       for (i = 0; i < 17; i++)
# 1877|->         tab[i] = 0xff - (i * 255) / 16;
# 1878|       return tab;
# 1879|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1888]
leptonica-1.87.0/src/scale2.c:1877:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/scale2.c:1875:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/scale2.c:1876:17: branch_true: following ‘true’ branch (when ‘i != 17’)...
leptonica-1.87.0/src/scale2.c:1877:25: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:1877:9: danger: ‘tab + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 1875|       tab = (l_uint8 *)LEPT_CALLOC(17, sizeof(l_uint8));
# 1876|       for (i = 0; i < 17; i++)
# 1877|->         tab[i] = 0xff - (i * 255) / 16;
# 1878|       return tab;
# 1879|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1889]
leptonica-1.87.0/src/scale2.c:2022: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2020|       tab = (l_uint8 *)LEPT_CALLOC(37, sizeof(l_uint8));
# 2021|       for (i = 0; i < 37; i++)
# 2022|->         tab[i] = 0xff - (i * 255) / 36;
# 2023|       return tab;
# 2024|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1890]
leptonica-1.87.0/src/scale2.c:2022:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/scale2.c:2020:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/scale2.c:2021:17: branch_true: following ‘true’ branch (when ‘i != 37’)...
leptonica-1.87.0/src/scale2.c:2022:25: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:2022:9: danger: ‘tab + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 2020|       tab = (l_uint8 *)LEPT_CALLOC(37, sizeof(l_uint8));
# 2021|       for (i = 0; i < 37; i++)
# 2022|->         tab[i] = 0xff - (i * 255) / 36;
# 2023|       return tab;
# 2024|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1891]
leptonica-1.87.0/src/scale2.c:2114: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tab
# 2112|       tab = (l_uint8 *)LEPT_CALLOC(65, sizeof(l_uint8));
# 2113|       for (i = 0; i < 65; i++)
# 2114|->         tab[i] = 0xff - (i * 255) / 64;
# 2115|       return tab;
# 2116|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1892]
leptonica-1.87.0/src/scale2.c:2114:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘tab’
leptonica-1.87.0/src/scale2.c:2112:22: acquire_memory: this call could return NULL
leptonica-1.87.0/src/scale2.c:2113:17: branch_true: following ‘true’ branch (when ‘i != 65’)...
leptonica-1.87.0/src/scale2.c:2114:25: branch_true: ...to here
leptonica-1.87.0/src/scale2.c:2114:9: danger: ‘tab + (sizetype)i’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 2112|       tab = (l_uint8 *)LEPT_CALLOC(65, sizeof(l_uint8));
# 2113|       for (i = 0; i < 65; i++)
# 2114|->         tab[i] = 0xff - (i * 255) / 64;
# 2115|       return tab;
# 2116|   }

Error: GCC_ANALYZER_WARNING: [#def1893]
leptonica-1.87.0/src/scale2.c:2248:28: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.87.0/src/scale2.c:797:1: enter_function: entry to ‘pixScaleMipmap’
leptonica-1.87.0/src/scale2.c:805:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:808:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:813:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:815:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:817:15: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:817:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:822:14: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:828:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:830:5: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:836:5: call_function: calling ‘scaleMipmapLow’ from ‘pixScaleMipmap’
# 2246|              resolution src pixels are obtained from these arrays
# 2247|              by multiplying by 2. */
# 2248|->     if ((srow = (l_int32 *)LEPT_CALLOC(hd, sizeof(l_int32))) == NULL)
# 2249|           return ERROR_INT("srow not made", __func__, 1);
# 2250|       if ((scol = (l_int32 *)LEPT_CALLOC(wd, sizeof(l_int32))) == NULL) {

Error: GCC_ANALYZER_WARNING: [#def1894]
leptonica-1.87.0/src/scale2.c:2250:28: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
leptonica-1.87.0/src/scale2.c:797:1: enter_function: entry to ‘pixScaleMipmap’
leptonica-1.87.0/src/scale2.c:805:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:808:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:813:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:815:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:817:15: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:817:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:822:14: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:828:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/scale2.c:830:5: branch_false: ...to here
leptonica-1.87.0/src/scale2.c:836:5: call_function: calling ‘scaleMipmapLow’ from ‘pixScaleMipmap’
# 2248|       if ((srow = (l_int32 *)LEPT_CALLOC(hd, sizeof(l_int32))) == NULL)
# 2249|           return ERROR_INT("srow not made", __func__, 1);
# 2250|->     if ((scol = (l_int32 *)LEPT_CALLOC(wd, sizeof(l_int32))) == NULL) {
# 2251|           LEPT_FREE(srow);
# 2252|           return ERROR_INT("scol not made", __func__, 1);

Error: CPPCHECK_WARNING (CWE-476): [#def1895]
leptonica-1.87.0/src/seedfill.c:1144: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1142|                       if (boolval) {
# 1143|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1144|->                         pixel->x = i;
# 1145|                           pixel->y = j;
# 1146|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1896]
leptonica-1.87.0/src/seedfill.c:1145: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1143|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1144|                           pixel->x = i;
# 1145|->                         pixel->y = j;
# 1146|                           lqueueAdd(lq_pixel, pixel);
# 1147|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1897]
leptonica-1.87.0/src/seedfill.c:1178: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1176|                           SET_DATA_BYTE(lines - wpls, j, L_MIN(val, maskval));
# 1177|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1178|->                         pixel->x = i - 1;
# 1179|                           pixel->y = j;
# 1180|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1898]
leptonica-1.87.0/src/seedfill.c:1178:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1176|                           SET_DATA_BYTE(lines - wpls, j, L_MIN(val, maskval));
# 1177|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1178|->                         pixel->x = i - 1;
# 1179|                           pixel->y = j;
# 1180|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1899]
leptonica-1.87.0/src/seedfill.c:1179: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1177|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1178|                           pixel->x = i - 1;
# 1179|->                         pixel->y = j;
# 1180|                           lqueueAdd(lq_pixel, pixel);
# 1181|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1900]
leptonica-1.87.0/src/seedfill.c:1180:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1178|                           pixel->x = i - 1;
# 1179|                           pixel->y = j;
# 1180|->                         lqueueAdd(lq_pixel, pixel);
# 1181|                       }
# 1182|   

Error: CPPCHECK_WARNING (CWE-476): [#def1901]
leptonica-1.87.0/src/seedfill.c:1190: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1188|                           SET_DATA_BYTE(lines, j - 1, L_MIN(val, maskval));
# 1189|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1190|->                         pixel->x = i;
# 1191|                           pixel->y = j - 1;
# 1192|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1902]
leptonica-1.87.0/src/seedfill.c:1190:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1188|                           SET_DATA_BYTE(lines, j - 1, L_MIN(val, maskval));
# 1189|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1190|->                         pixel->x = i;
# 1191|                           pixel->y = j - 1;
# 1192|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1903]
leptonica-1.87.0/src/seedfill.c:1191: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1189|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1190|                           pixel->x = i;
# 1191|->                         pixel->y = j - 1;
# 1192|                           lqueueAdd(lq_pixel, pixel);
# 1193|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1904]
leptonica-1.87.0/src/seedfill.c:1192:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1190|                           pixel->x = i;
# 1191|                           pixel->y = j - 1;
# 1192|->                         lqueueAdd(lq_pixel, pixel);
# 1193|                       }
# 1194|                   }

Error: CPPCHECK_WARNING (CWE-476): [#def1905]
leptonica-1.87.0/src/seedfill.c:1201: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1199|                           SET_DATA_BYTE(lines + wpls, j, L_MIN(val, maskval));
# 1200|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1201|->                         pixel->x = i + 1;
# 1202|                           pixel->y = j;
# 1203|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1906]
leptonica-1.87.0/src/seedfill.c:1201:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1199|                           SET_DATA_BYTE(lines + wpls, j, L_MIN(val, maskval));
# 1200|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1201|->                         pixel->x = i + 1;
# 1202|                           pixel->y = j;
# 1203|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1907]
leptonica-1.87.0/src/seedfill.c:1202: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1200|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1201|                           pixel->x = i + 1;
# 1202|->                         pixel->y = j;
# 1203|                           lqueueAdd(lq_pixel, pixel);
# 1204|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1908]
leptonica-1.87.0/src/seedfill.c:1203:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1201|                           pixel->x = i + 1;
# 1202|                           pixel->y = j;
# 1203|->                         lqueueAdd(lq_pixel, pixel);
# 1204|                       }
# 1205|                   }

Error: CPPCHECK_WARNING (CWE-476): [#def1909]
leptonica-1.87.0/src/seedfill.c:1212: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1210|                           SET_DATA_BYTE(lines, j + 1, L_MIN(val, maskval));
# 1211|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1212|->                         pixel->x = i;
# 1213|                           pixel->y = j + 1;
# 1214|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1910]
leptonica-1.87.0/src/seedfill.c:1212:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1210|                           SET_DATA_BYTE(lines, j + 1, L_MIN(val, maskval));
# 1211|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1212|->                         pixel->x = i;
# 1213|                           pixel->y = j + 1;
# 1214|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1911]
leptonica-1.87.0/src/seedfill.c:1213: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1211|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1212|                           pixel->x = i;
# 1213|->                         pixel->y = j + 1;
# 1214|                           lqueueAdd(lq_pixel, pixel);
# 1215|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1912]
leptonica-1.87.0/src/seedfill.c:1214:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1212|                           pixel->x = i;
# 1213|                           pixel->y = j + 1;
# 1214|->                         lqueueAdd(lq_pixel, pixel);
# 1215|                       }
# 1216|                   }

Error: CPPCHECK_WARNING (CWE-476): [#def1913]
leptonica-1.87.0/src/seedfill.c:1323: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1321|                       if (boolval) {
# 1322|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1323|->                         pixel->x = i;
# 1324|                           pixel->y = j;
# 1325|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1914]
leptonica-1.87.0/src/seedfill.c:1324: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1322|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1323|                           pixel->x = i;
# 1324|->                         pixel->y = j;
# 1325|                           lqueueAdd(lq_pixel, pixel);
# 1326|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1915]
leptonica-1.87.0/src/seedfill.c:1359: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1357|                                             L_MIN(val, maskval));
# 1358|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1359|->                             pixel->x = i - 1;
# 1360|                               pixel->y = j - 1;
# 1361|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1916]
leptonica-1.87.0/src/seedfill.c:1359:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1357|                                             L_MIN(val, maskval));
# 1358|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1359|->                             pixel->x = i - 1;
# 1360|                               pixel->y = j - 1;
# 1361|                               lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1917]
leptonica-1.87.0/src/seedfill.c:1360: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1358|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1359|                               pixel->x = i - 1;
# 1360|->                             pixel->y = j - 1;
# 1361|                               lqueueAdd(lq_pixel, pixel);
# 1362|                           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1918]
leptonica-1.87.0/src/seedfill.c:1361:29: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1359|                               pixel->x = i - 1;
# 1360|                               pixel->y = j - 1;
# 1361|->                             lqueueAdd(lq_pixel, pixel);
# 1362|                           }
# 1363|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1919]
leptonica-1.87.0/src/seedfill.c:1371: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1369|                                             L_MIN(val, maskval));
# 1370|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1371|->                             pixel->x = i - 1;
# 1372|                               pixel->y = j + 1;
# 1373|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1920]
leptonica-1.87.0/src/seedfill.c:1371:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1369|                                             L_MIN(val, maskval));
# 1370|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1371|->                             pixel->x = i - 1;
# 1372|                               pixel->y = j + 1;
# 1373|                               lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1921]
leptonica-1.87.0/src/seedfill.c:1372: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1370|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1371|                               pixel->x = i - 1;
# 1372|->                             pixel->y = j + 1;
# 1373|                               lqueueAdd(lq_pixel, pixel);
# 1374|                           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1922]
leptonica-1.87.0/src/seedfill.c:1373:29: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1371|                               pixel->x = i - 1;
# 1372|                               pixel->y = j + 1;
# 1373|->                             lqueueAdd(lq_pixel, pixel);
# 1374|                           }
# 1375|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1923]
leptonica-1.87.0/src/seedfill.c:1381: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1379|                           SET_DATA_BYTE(lines - wpls, j, L_MIN(val, maskval));
# 1380|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1381|->                         pixel->x = i - 1;
# 1382|                           pixel->y = j;
# 1383|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1924]
leptonica-1.87.0/src/seedfill.c:1381:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1379|                           SET_DATA_BYTE(lines - wpls, j, L_MIN(val, maskval));
# 1380|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1381|->                         pixel->x = i - 1;
# 1382|                           pixel->y = j;
# 1383|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1925]
leptonica-1.87.0/src/seedfill.c:1382: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1380|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1381|                           pixel->x = i - 1;
# 1382|->                         pixel->y = j;
# 1383|                           lqueueAdd(lq_pixel, pixel);
# 1384|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1926]
leptonica-1.87.0/src/seedfill.c:1383:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1381|                           pixel->x = i - 1;
# 1382|                           pixel->y = j;
# 1383|->                         lqueueAdd(lq_pixel, pixel);
# 1384|                       }
# 1385|   

Error: CPPCHECK_WARNING (CWE-476): [#def1927]
leptonica-1.87.0/src/seedfill.c:1393: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1391|                           SET_DATA_BYTE(lines, j - 1, L_MIN(val, maskval));
# 1392|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1393|->                         pixel->x = i;
# 1394|                           pixel->y = j - 1;
# 1395|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1928]
leptonica-1.87.0/src/seedfill.c:1393:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1391|                           SET_DATA_BYTE(lines, j - 1, L_MIN(val, maskval));
# 1392|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1393|->                         pixel->x = i;
# 1394|                           pixel->y = j - 1;
# 1395|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1929]
leptonica-1.87.0/src/seedfill.c:1394: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1392|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1393|                           pixel->x = i;
# 1394|->                         pixel->y = j - 1;
# 1395|                           lqueueAdd(lq_pixel, pixel);
# 1396|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1930]
leptonica-1.87.0/src/seedfill.c:1395:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1393|                           pixel->x = i;
# 1394|                           pixel->y = j - 1;
# 1395|->                         lqueueAdd(lq_pixel, pixel);
# 1396|                       }
# 1397|                   }

Error: CPPCHECK_WARNING (CWE-476): [#def1931]
leptonica-1.87.0/src/seedfill.c:1406: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1404|                                             L_MIN(val, maskval));
# 1405|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1406|->                             pixel->x = i + 1;
# 1407|                               pixel->y = j - 1;
# 1408|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1932]
leptonica-1.87.0/src/seedfill.c:1406:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1404|                                             L_MIN(val, maskval));
# 1405|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1406|->                             pixel->x = i + 1;
# 1407|                               pixel->y = j - 1;
# 1408|                               lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1933]
leptonica-1.87.0/src/seedfill.c:1407: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1405|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1406|                               pixel->x = i + 1;
# 1407|->                             pixel->y = j - 1;
# 1408|                               lqueueAdd(lq_pixel, pixel);
# 1409|                           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1934]
leptonica-1.87.0/src/seedfill.c:1408:29: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1406|                               pixel->x = i + 1;
# 1407|                               pixel->y = j - 1;
# 1408|->                             lqueueAdd(lq_pixel, pixel);
# 1409|                           }
# 1410|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1935]
leptonica-1.87.0/src/seedfill.c:1418: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1416|                                             L_MIN(val, maskval));
# 1417|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1418|->                             pixel->x = i + 1;
# 1419|                               pixel->y = j + 1;
# 1420|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1936]
leptonica-1.87.0/src/seedfill.c:1418:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1416|                                             L_MIN(val, maskval));
# 1417|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1418|->                             pixel->x = i + 1;
# 1419|                               pixel->y = j + 1;
# 1420|                               lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1937]
leptonica-1.87.0/src/seedfill.c:1419: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1417|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1418|                               pixel->x = i + 1;
# 1419|->                             pixel->y = j + 1;
# 1420|                               lqueueAdd(lq_pixel, pixel);
# 1421|                           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1938]
leptonica-1.87.0/src/seedfill.c:1420:29: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1418|                               pixel->x = i + 1;
# 1419|                               pixel->y = j + 1;
# 1420|->                             lqueueAdd(lq_pixel, pixel);
# 1421|                           }
# 1422|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1939]
leptonica-1.87.0/src/seedfill.c:1428: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1426|                           SET_DATA_BYTE(lines + wpls, j, L_MIN(val, maskval));
# 1427|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1428|->                         pixel->x = i + 1;
# 1429|                           pixel->y = j;
# 1430|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1940]
leptonica-1.87.0/src/seedfill.c:1428:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1426|                           SET_DATA_BYTE(lines + wpls, j, L_MIN(val, maskval));
# 1427|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1428|->                         pixel->x = i + 1;
# 1429|                           pixel->y = j;
# 1430|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1941]
leptonica-1.87.0/src/seedfill.c:1429: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1427|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1428|                           pixel->x = i + 1;
# 1429|->                         pixel->y = j;
# 1430|                           lqueueAdd(lq_pixel, pixel);
# 1431|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1942]
leptonica-1.87.0/src/seedfill.c:1430:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:911:1: enter_function: entry to ‘pixSeedfillGray’
leptonica-1.87.0/src/seedfill.c:920:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:922:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:926:9: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:926:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:929:13: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:934:5: call_function: calling ‘seedfillGrayLow’ from ‘pixSeedfillGray’
# 1428|                           pixel->x = i + 1;
# 1429|                           pixel->y = j;
# 1430|->                         lqueueAdd(lq_pixel, pixel);
# 1431|                       }
# 1432|                   }

Error: CPPCHECK_WARNING (CWE-476): [#def1943]
leptonica-1.87.0/src/seedfill.c:1439: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1437|                           SET_DATA_BYTE(lines, j + 1, L_MIN(val, maskval));
# 1438|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1439|->                         pixel->x = i;
# 1440|                           pixel->y = j + 1;
# 1441|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1944]
leptonica-1.87.0/src/seedfill.c:1440: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1438|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1439|                           pixel->x = i;
# 1440|->                         pixel->y = j + 1;
# 1441|                           lqueueAdd(lq_pixel, pixel);
# 1442|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1945]
leptonica-1.87.0/src/seedfill.c:1600: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1598|                       if (boolval) {
# 1599|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1600|->                         pixel->x = i;
# 1601|                           pixel->y = j;
# 1602|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1946]
leptonica-1.87.0/src/seedfill.c:1601: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1599|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1600|                           pixel->x = i;
# 1601|->                         pixel->y = j;
# 1602|                           lqueueAdd(lq_pixel, pixel);
# 1603|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1947]
leptonica-1.87.0/src/seedfill.c:1634: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1632|                           SET_DATA_BYTE(lines - wpls, j, val);
# 1633|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1634|->                         pixel->x = i - 1;
# 1635|                           pixel->y = j;
# 1636|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1948]
leptonica-1.87.0/src/seedfill.c:1634:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: following ‘false’ branch (when ‘connectivity != 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1619:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1620:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1627:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1628:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1628:20: branch_true: following ‘true’ branch (when ‘i > 0’)...
leptonica-1.87.0/src/seedfill.c:1629:28: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1631:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1632:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1633:44: acquire_memory: this call could return NULL
leptonica-1.87.0/src/seedfill.c:1634:25: danger: ‘pixel’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/12)
# 1632|                           SET_DATA_BYTE(lines - wpls, j, val);
# 1633|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1634|->                         pixel->x = i - 1;
# 1635|                           pixel->y = j;
# 1636|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1949]
leptonica-1.87.0/src/seedfill.c:1635: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1633|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1634|                           pixel->x = i - 1;
# 1635|->                         pixel->y = j;
# 1636|                           lqueueAdd(lq_pixel, pixel);
# 1637|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1950]
leptonica-1.87.0/src/seedfill.c:1636:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: following ‘false’ branch (when ‘connectivity != 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1619:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1620:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1627:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1628:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1628:20: branch_true: following ‘true’ branch (when ‘i > 0’)...
leptonica-1.87.0/src/seedfill.c:1629:28: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1631:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1632:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1633:44: acquire_memory: allocated here
leptonica-1.87.0/src/seedfill.c:1636:25: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/seedfill.c:1636:25: danger: ‘pixel’ leaks here; was allocated at [(13)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/12)
# 1634|                           pixel->x = i - 1;
# 1635|                           pixel->y = j;
# 1636|->                         lqueueAdd(lq_pixel, pixel);
# 1637|                       }
# 1638|   

Error: CPPCHECK_WARNING (CWE-476): [#def1951]
leptonica-1.87.0/src/seedfill.c:1646: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1644|                           SET_DATA_BYTE(lines, j - 1, val);
# 1645|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1646|->                         pixel->x = i;
# 1647|                           pixel->y = j - 1;
# 1648|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1952]
leptonica-1.87.0/src/seedfill.c:1646:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: following ‘false’ branch (when ‘connectivity != 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1619:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1620:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1627:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1628:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1640:20: branch_true: following ‘true’ branch (when ‘j > 0’)...
leptonica-1.87.0/src/seedfill.c:1641:28: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1643:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1644:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1645:44: acquire_memory: this call could return NULL
leptonica-1.87.0/src/seedfill.c:1646:25: danger: ‘pixel’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/12)
# 1644|                           SET_DATA_BYTE(lines, j - 1, val);
# 1645|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1646|->                         pixel->x = i;
# 1647|                           pixel->y = j - 1;
# 1648|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1953]
leptonica-1.87.0/src/seedfill.c:1647: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1645|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1646|                           pixel->x = i;
# 1647|->                         pixel->y = j - 1;
# 1648|                           lqueueAdd(lq_pixel, pixel);
# 1649|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1954]
leptonica-1.87.0/src/seedfill.c:1648:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: following ‘false’ branch (when ‘connectivity != 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1619:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1620:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1627:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1628:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1640:20: branch_true: following ‘true’ branch (when ‘j > 0’)...
leptonica-1.87.0/src/seedfill.c:1641:28: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1643:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1644:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1645:44: acquire_memory: allocated here
leptonica-1.87.0/src/seedfill.c:1648:25: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/seedfill.c:1648:25: danger: ‘pixel’ leaks here; was allocated at [(13)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/12)
# 1646|                           pixel->x = i;
# 1647|                           pixel->y = j - 1;
# 1648|->                         lqueueAdd(lq_pixel, pixel);
# 1649|                       }
# 1650|                   }

Error: CPPCHECK_WARNING (CWE-476): [#def1955]
leptonica-1.87.0/src/seedfill.c:1657: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1655|                           SET_DATA_BYTE(lines + wpls, j, val);
# 1656|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1657|->                         pixel->x = i + 1;
# 1658|                           pixel->y = j;
# 1659|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1956]
leptonica-1.87.0/src/seedfill.c:1657:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: following ‘false’ branch (when ‘connectivity != 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1619:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1620:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1627:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1628:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1651:20: branch_true: following ‘true’ branch (when ‘imax > i’)...
leptonica-1.87.0/src/seedfill.c:1652:28: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1654:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1655:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1656:44: acquire_memory: this call could return NULL
leptonica-1.87.0/src/seedfill.c:1657:25: danger: ‘pixel’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/12)
# 1655|                           SET_DATA_BYTE(lines + wpls, j, val);
# 1656|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1657|->                         pixel->x = i + 1;
# 1658|                           pixel->y = j;
# 1659|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1957]
leptonica-1.87.0/src/seedfill.c:1658: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1656|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1657|                           pixel->x = i + 1;
# 1658|->                         pixel->y = j;
# 1659|                           lqueueAdd(lq_pixel, pixel);
# 1660|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1958]
leptonica-1.87.0/src/seedfill.c:1659:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: following ‘false’ branch (when ‘connectivity != 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1619:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1620:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1627:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1628:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1651:20: branch_true: following ‘true’ branch (when ‘imax > i’)...
leptonica-1.87.0/src/seedfill.c:1652:28: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1654:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1655:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1656:44: acquire_memory: allocated here
leptonica-1.87.0/src/seedfill.c:1659:25: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/seedfill.c:1659:25: danger: ‘pixel’ leaks here; was allocated at [(13)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/12)
# 1657|                           pixel->x = i + 1;
# 1658|                           pixel->y = j;
# 1659|->                         lqueueAdd(lq_pixel, pixel);
# 1660|                       }
# 1661|                   }

Error: CPPCHECK_WARNING (CWE-476): [#def1959]
leptonica-1.87.0/src/seedfill.c:1668: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1666|                           SET_DATA_BYTE(lines, j + 1, val);
# 1667|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1668|->                         pixel->x = i;
# 1669|                           pixel->y = j + 1;
# 1670|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1960]
leptonica-1.87.0/src/seedfill.c:1668:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: following ‘false’ branch (when ‘connectivity != 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1619:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1620:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1627:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1628:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1662:20: branch_true: following ‘true’ branch (when ‘jmax > j’)...
leptonica-1.87.0/src/seedfill.c:1663:28: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1665:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1666:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1667:44: acquire_memory: this call could return NULL
leptonica-1.87.0/src/seedfill.c:1668:25: danger: ‘pixel’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/12)
# 1666|                           SET_DATA_BYTE(lines, j + 1, val);
# 1667|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1668|->                         pixel->x = i;
# 1669|                           pixel->y = j + 1;
# 1670|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1961]
leptonica-1.87.0/src/seedfill.c:1669: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1667|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1668|                           pixel->x = i;
# 1669|->                         pixel->y = j + 1;
# 1670|                           lqueueAdd(lq_pixel, pixel);
# 1671|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1962]
leptonica-1.87.0/src/seedfill.c:1670:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: following ‘false’ branch (when ‘connectivity != 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1619:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1620:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1627:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1628:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1662:20: branch_true: following ‘true’ branch (when ‘jmax > j’)...
leptonica-1.87.0/src/seedfill.c:1663:28: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1665:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1666:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1667:44: acquire_memory: allocated here
leptonica-1.87.0/src/seedfill.c:1670:25: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/seedfill.c:1670:25: danger: ‘pixel’ leaks here; was allocated at [(13)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/12)
# 1668|                           pixel->x = i;
# 1669|                           pixel->y = j + 1;
# 1670|->                         lqueueAdd(lq_pixel, pixel);
# 1671|                       }
# 1672|                   }

Error: CPPCHECK_WARNING (CWE-476): [#def1963]
leptonica-1.87.0/src/seedfill.c:1786: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1784|                       if (boolval) {
# 1785|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1786|->                         pixel->x = i;
# 1787|                           pixel->y = j;
# 1788|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1964]
leptonica-1.87.0/src/seedfill.c:1787: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1785|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1786|                           pixel->x = i;
# 1787|->                         pixel->y = j;
# 1788|                           lqueueAdd(lq_pixel, pixel);
# 1789|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1965]
leptonica-1.87.0/src/seedfill.c:1821: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1819|                               SET_DATA_BYTE(lines - wpls, j - 1, val);
# 1820|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1821|->                             pixel->x = i - 1;
# 1822|                               pixel->y = j - 1;
# 1823|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1966]
leptonica-1.87.0/src/seedfill.c:1821:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: following ‘true’ branch (when ‘connectivity == 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1805:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1806:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1813:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: following ‘true’ branch (when ‘i > 0’)...
leptonica-1.87.0/src/seedfill.c:1815:24: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1815:24: branch_true: following ‘true’ branch (when ‘j > 0’)...
leptonica-1.87.0/src/seedfill.c:1816:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1818:28: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1819:29: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1820:48: acquire_memory: this call could return NULL
leptonica-1.87.0/src/seedfill.c:1821:29: danger: ‘pixel’ could be NULL: unchecked value from [(15)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/14)
# 1819|                               SET_DATA_BYTE(lines - wpls, j - 1, val);
# 1820|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1821|->                             pixel->x = i - 1;
# 1822|                               pixel->y = j - 1;
# 1823|                               lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1967]
leptonica-1.87.0/src/seedfill.c:1822: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1820|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1821|                               pixel->x = i - 1;
# 1822|->                             pixel->y = j - 1;
# 1823|                               lqueueAdd(lq_pixel, pixel);
# 1824|                           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1968]
leptonica-1.87.0/src/seedfill.c:1823:29: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: following ‘true’ branch (when ‘connectivity == 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1805:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1806:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1813:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: following ‘true’ branch (when ‘i > 0’)...
leptonica-1.87.0/src/seedfill.c:1815:24: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1815:24: branch_true: following ‘true’ branch (when ‘j > 0’)...
leptonica-1.87.0/src/seedfill.c:1816:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1818:28: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1819:29: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1820:48: acquire_memory: allocated here
leptonica-1.87.0/src/seedfill.c:1823:29: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/seedfill.c:1823:29: danger: ‘pixel’ leaks here; was allocated at [(15)](sarif:/runs/0/results/31/codeFlows/0/threadFlows/0/locations/14)
# 1821|                               pixel->x = i - 1;
# 1822|                               pixel->y = j - 1;
# 1823|->                             lqueueAdd(lq_pixel, pixel);
# 1824|                           }
# 1825|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1969]
leptonica-1.87.0/src/seedfill.c:1832: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1830|                               SET_DATA_BYTE(lines - wpls, j + 1, val);
# 1831|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1832|->                             pixel->x = i - 1;
# 1833|                               pixel->y = j + 1;
# 1834|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1970]
leptonica-1.87.0/src/seedfill.c:1832:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: following ‘true’ branch (when ‘connectivity == 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1805:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1806:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1813:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: following ‘true’ branch (when ‘i > 0’)...
leptonica-1.87.0/src/seedfill.c:1815:24: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1826:24: branch_true: following ‘true’ branch (when ‘jmax > j’)...
leptonica-1.87.0/src/seedfill.c:1827:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1829:28: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1830:29: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1831:48: acquire_memory: this call could return NULL
leptonica-1.87.0/src/seedfill.c:1832:29: danger: ‘pixel’ could be NULL: unchecked value from [(15)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/14)
# 1830|                               SET_DATA_BYTE(lines - wpls, j + 1, val);
# 1831|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1832|->                             pixel->x = i - 1;
# 1833|                               pixel->y = j + 1;
# 1834|                               lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1971]
leptonica-1.87.0/src/seedfill.c:1833: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1831|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1832|                               pixel->x = i - 1;
# 1833|->                             pixel->y = j + 1;
# 1834|                               lqueueAdd(lq_pixel, pixel);
# 1835|                           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1972]
leptonica-1.87.0/src/seedfill.c:1834:29: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: following ‘true’ branch (when ‘connectivity == 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1805:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1806:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1813:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: following ‘true’ branch (when ‘i > 0’)...
leptonica-1.87.0/src/seedfill.c:1815:24: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1826:24: branch_true: following ‘true’ branch (when ‘jmax > j’)...
leptonica-1.87.0/src/seedfill.c:1827:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1829:28: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1830:29: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1831:48: acquire_memory: allocated here
leptonica-1.87.0/src/seedfill.c:1834:29: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/seedfill.c:1834:29: danger: ‘pixel’ leaks here; was allocated at [(15)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/14)
# 1832|                               pixel->x = i - 1;
# 1833|                               pixel->y = j + 1;
# 1834|->                             lqueueAdd(lq_pixel, pixel);
# 1835|                           }
# 1836|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1973]
leptonica-1.87.0/src/seedfill.c:1842: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1840|                           SET_DATA_BYTE(lines - wpls, j, val);
# 1841|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1842|->                         pixel->x = i - 1;
# 1843|                           pixel->y = j;
# 1844|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1974]
leptonica-1.87.0/src/seedfill.c:1842:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: following ‘true’ branch (when ‘connectivity == 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1805:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1806:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1813:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: following ‘true’ branch (when ‘i > 0’)...
leptonica-1.87.0/src/seedfill.c:1815:24: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1839:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1840:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1841:44: acquire_memory: this call could return NULL
leptonica-1.87.0/src/seedfill.c:1842:25: danger: ‘pixel’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/12)
# 1840|                           SET_DATA_BYTE(lines - wpls, j, val);
# 1841|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1842|->                         pixel->x = i - 1;
# 1843|                           pixel->y = j;
# 1844|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1975]
leptonica-1.87.0/src/seedfill.c:1843: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1841|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1842|                           pixel->x = i - 1;
# 1843|->                         pixel->y = j;
# 1844|                           lqueueAdd(lq_pixel, pixel);
# 1845|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1976]
leptonica-1.87.0/src/seedfill.c:1844:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: following ‘true’ branch (when ‘connectivity == 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1805:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1806:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1813:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: following ‘true’ branch (when ‘i > 0’)...
leptonica-1.87.0/src/seedfill.c:1815:24: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1839:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1840:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1841:44: acquire_memory: allocated here
leptonica-1.87.0/src/seedfill.c:1844:25: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/seedfill.c:1844:25: danger: ‘pixel’ leaks here; was allocated at [(13)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/12)
# 1842|                           pixel->x = i - 1;
# 1843|                           pixel->y = j;
# 1844|->                         lqueueAdd(lq_pixel, pixel);
# 1845|                       }
# 1846|   

Error: CPPCHECK_WARNING (CWE-476): [#def1977]
leptonica-1.87.0/src/seedfill.c:1854: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1852|                           SET_DATA_BYTE(lines, j - 1, val);
# 1853|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1854|->                         pixel->x = i;
# 1855|                           pixel->y = j - 1;
# 1856|                           lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1978]
leptonica-1.87.0/src/seedfill.c:1854:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: following ‘true’ branch (when ‘connectivity == 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1805:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1806:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1813:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1848:20: branch_true: following ‘true’ branch (when ‘j > 0’)...
leptonica-1.87.0/src/seedfill.c:1849:28: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1851:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1852:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1853:44: acquire_memory: this call could return NULL
leptonica-1.87.0/src/seedfill.c:1854:25: danger: ‘pixel’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/12)
# 1852|                           SET_DATA_BYTE(lines, j - 1, val);
# 1853|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1854|->                         pixel->x = i;
# 1855|                           pixel->y = j - 1;
# 1856|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1979]
leptonica-1.87.0/src/seedfill.c:1855: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1853|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1854|                           pixel->x = i;
# 1855|->                         pixel->y = j - 1;
# 1856|                           lqueueAdd(lq_pixel, pixel);
# 1857|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1980]
leptonica-1.87.0/src/seedfill.c:1856:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: following ‘true’ branch (when ‘connectivity == 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1805:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1806:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1813:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1848:20: branch_true: following ‘true’ branch (when ‘j > 0’)...
leptonica-1.87.0/src/seedfill.c:1849:28: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1851:24: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1852:25: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1853:44: acquire_memory: allocated here
leptonica-1.87.0/src/seedfill.c:1856:25: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/seedfill.c:1856:25: danger: ‘pixel’ leaks here; was allocated at [(13)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/12)
# 1854|                           pixel->x = i;
# 1855|                           pixel->y = j - 1;
# 1856|->                         lqueueAdd(lq_pixel, pixel);
# 1857|                       }
# 1858|                   }

Error: CPPCHECK_WARNING (CWE-476): [#def1981]
leptonica-1.87.0/src/seedfill.c:1866: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1864|                               SET_DATA_BYTE(lines + wpls, j - 1, val);
# 1865|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1866|->                             pixel->x = i + 1;
# 1867|                               pixel->y = j - 1;
# 1868|                               lqueueAdd(lq_pixel, pixel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1982]
leptonica-1.87.0/src/seedfill.c:1866:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: following ‘true’ branch (when ‘connectivity == 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1805:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1806:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1813:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1859:20: branch_true: following ‘true’ branch (when ‘imax > i’)...
leptonica-1.87.0/src/seedfill.c:1860:24: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1860:24: branch_true: following ‘true’ branch (when ‘j > 0’)...
leptonica-1.87.0/src/seedfill.c:1861:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1863:28: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1864:29: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1865:48: acquire_memory: this call could return NULL
leptonica-1.87.0/src/seedfill.c:1866:29: danger: ‘pixel’ could be NULL: unchecked value from [(15)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/14)
# 1864|                               SET_DATA_BYTE(lines + wpls, j - 1, val);
# 1865|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1866|->                             pixel->x = i + 1;
# 1867|                               pixel->y = j - 1;
# 1868|                               lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1983]
leptonica-1.87.0/src/seedfill.c:1867: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1865|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1866|                               pixel->x = i + 1;
# 1867|->                             pixel->y = j - 1;
# 1868|                               lqueueAdd(lq_pixel, pixel);
# 1869|                           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1984]
leptonica-1.87.0/src/seedfill.c:1868:29: warning[-Wanalyzer-malloc-leak]: leak of ‘pixel’
leptonica-1.87.0/src/seedfill.c:1507:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/seedfill.c:1512:5: branch_false: ...to here
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: following ‘true’ branch (when ‘connectivity == 8’)...
leptonica-1.87.0/src/seedfill.c:1521:5: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1805:16: branch_true: following ‘true’ branch (when ‘queue_size != 0’)...
leptonica-1.87.0/src/seedfill.c:1806:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1813:16: branch_true: following ‘true’ branch (when ‘val != 0’)...
leptonica-1.87.0/src/seedfill.c:1814:20: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1859:20: branch_true: following ‘true’ branch (when ‘imax > i’)...
leptonica-1.87.0/src/seedfill.c:1860:24: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1860:24: branch_true: following ‘true’ branch (when ‘j > 0’)...
leptonica-1.87.0/src/seedfill.c:1861:32: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1863:28: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/seedfill.c:1864:29: branch_true: ...to here
leptonica-1.87.0/src/seedfill.c:1865:48: acquire_memory: allocated here
leptonica-1.87.0/src/seedfill.c:1868:29: throw: if ‘lqueueAdd’ throws an exception...
leptonica-1.87.0/src/seedfill.c:1868:29: danger: ‘pixel’ leaks here; was allocated at [(15)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/14)
# 1866|                               pixel->x = i + 1;
# 1867|                               pixel->y = j - 1;
# 1868|->                             lqueueAdd(lq_pixel, pixel);
# 1869|                           }
# 1870|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1985]
leptonica-1.87.0/src/seedfill.c:1877: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1875|                               SET_DATA_BYTE(lines + wpls, j + 1, val);
# 1876|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1877|->                             pixel->x = i + 1;
# 1878|                               pixel->y = j + 1;
# 1879|                               lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1986]
leptonica-1.87.0/src/seedfill.c:1878: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1876|                               pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1877|                               pixel->x = i + 1;
# 1878|->                             pixel->y = j + 1;
# 1879|                               lqueueAdd(lq_pixel, pixel);
# 1880|                           }

Error: CPPCHECK_WARNING (CWE-476): [#def1987]
leptonica-1.87.0/src/seedfill.c:1887: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1885|                           SET_DATA_BYTE(lines + wpls, j, val);
# 1886|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1887|->                         pixel->x = i + 1;
# 1888|                           pixel->y = j;
# 1889|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1988]
leptonica-1.87.0/src/seedfill.c:1888: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1886|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1887|                           pixel->x = i + 1;
# 1888|->                         pixel->y = j;
# 1889|                           lqueueAdd(lq_pixel, pixel);
# 1890|                       }

Error: CPPCHECK_WARNING (CWE-476): [#def1989]
leptonica-1.87.0/src/seedfill.c:1898: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1896|                           SET_DATA_BYTE(lines, j + 1, val);
# 1897|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1898|->                         pixel->x = i;
# 1899|                           pixel->y = j + 1;
# 1900|                           lqueueAdd(lq_pixel, pixel);

Error: CPPCHECK_WARNING (CWE-476): [#def1990]
leptonica-1.87.0/src/seedfill.c:1899: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pixel
# 1897|                           pixel = (L_PIXEL *)LEPT_CALLOC(1, sizeof(L_PIXEL));
# 1898|                           pixel->x = i;
# 1899|->                         pixel->y = j + 1;
# 1900|                           lqueueAdd(lq_pixel, pixel);
# 1901|                       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1991]
leptonica-1.87.0/src/sel1.c:255:9: warning[-Wanalyzer-malloc-leak]: leak of ‘selaCreate(pixaGetCount(pixa))’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2143:15: throw: if ‘pixaGetPix’ throws an exception...
leptonica-1.87.0/src/sel1.c:255:9: danger: ‘selaCreate(pixaGetCount(pixa))’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#  253|   SELA  *sela;
#  254|   
#  255|->     if (n <= 0 || n > (l_int32)MaxPtrArraySize)
#  256|           n = InitialPtrArraySize;
#  257|   

Error: CPPCHECK_WARNING (CWE-476): [#def1992]
leptonica-1.87.0/src/sel1.c:260: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sela
#  258|           /* Make array of sel ptrs */
#  259|       sela = (SELA *)LEPT_CALLOC(1, sizeof(SELA));
#  260|->     sela->nalloc = n;
#  261|       sela->n = 0;
#  262|       sela->sel = (SEL **)LEPT_CALLOC(n, sizeof(SEL *));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1993]
leptonica-1.87.0/src/sel1.c:260:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sela’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
#  258|           /* Make array of sel ptrs */
#  259|       sela = (SELA *)LEPT_CALLOC(1, sizeof(SELA));
#  260|->     sela->nalloc = n;
#  261|       sela->n = 0;
#  262|       sela->sel = (SEL **)LEPT_CALLOC(n, sizeof(SEL *));

Error: CPPCHECK_WARNING (CWE-476): [#def1994]
leptonica-1.87.0/src/sel1.c:261: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sela
#  259|       sela = (SELA *)LEPT_CALLOC(1, sizeof(SELA));
#  260|       sela->nalloc = n;
#  261|->     sela->n = 0;
#  262|       sela->sel = (SEL **)LEPT_CALLOC(n, sizeof(SEL *));
#  263|       return sela;

Error: CPPCHECK_WARNING (CWE-476): [#def1995]
leptonica-1.87.0/src/sel1.c:262: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sela
#  260|       sela->nalloc = n;
#  261|       sela->n = 0;
#  262|->     sela->sel = (SEL **)LEPT_CALLOC(n, sizeof(SEL *));
#  263|       return sela;
#  264|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1996]
leptonica-1.87.0/src/sel1.c:316: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sel
#  314|       sel = (SEL *)LEPT_CALLOC(1, sizeof(SEL));
#  315|       if (name)
#  316|->         sel->name = stringNew(name);
#  317|       sel->sy = height;
#  318|       sel->sx = width;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1997]
leptonica-1.87.0/src/sel1.c:316:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sel’
leptonica-1.87.0/src/sel1.c:1350:1: enter_function: entry to ‘selReadStream’
leptonica-1.87.0/src/sel1.c:1360:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1362:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1362:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1365:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1365:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1367:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1369:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1373:16: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1373:16: call_function: calling ‘selCreate’ from ‘selReadStream’
#  314|       sel = (SEL *)LEPT_CALLOC(1, sizeof(SEL));
#  315|       if (name)
#  316|->         sel->name = stringNew(name);
#  317|       sel->sy = height;
#  318|       sel->sx = width;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1998]
leptonica-1.87.0/src/sel1.c:316:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
#  314|       sel = (SEL *)LEPT_CALLOC(1, sizeof(SEL));
#  315|       if (name)
#  316|->         sel->name = stringNew(name);
#  317|       sel->sy = height;
#  318|       sel->sx = width;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1999]
leptonica-1.87.0/src/sel1.c:316:21: warning[-Wanalyzer-malloc-leak]: leak of ‘sela’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
#  314|       sel = (SEL *)LEPT_CALLOC(1, sizeof(SEL));
#  315|       if (name)
#  316|->         sel->name = stringNew(name);
#  317|       sel->sy = height;
#  318|       sel->sx = width;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2000]
leptonica-1.87.0/src/sel1.c:316:21: warning[-Wanalyzer-malloc-leak]: leak of ‘sel’
leptonica-1.87.0/src/sel1.c:1350:1: enter_function: entry to ‘selReadStream’
leptonica-1.87.0/src/sel1.c:1360:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1362:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1362:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1365:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1365:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1367:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1369:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1373:16: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1373:16: call_function: calling ‘selCreate’ from ‘selReadStream’
#  314|       sel = (SEL *)LEPT_CALLOC(1, sizeof(SEL));
#  315|       if (name)
#  316|->         sel->name = stringNew(name);
#  317|       sel->sy = height;
#  318|       sel->sx = width;

Error: CPPCHECK_WARNING (CWE-476): [#def2001]
leptonica-1.87.0/src/sel1.c:317: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sel
#  315|       if (name)
#  316|           sel->name = stringNew(name);
#  317|->     sel->sy = height;
#  318|       sel->sx = width;
#  319|       if ((sel->data = create2dIntArray(height, width)) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2002]
leptonica-1.87.0/src/sel1.c:317:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sel’
leptonica-1.87.0/src/sel1.c:410:1: enter_function: entry to ‘selCreateBrick’
leptonica-1.87.0/src/sel1.c:421:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:424:16: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:424:16: call_function: calling ‘selCreate’ from ‘selCreateBrick’
#  315|       if (name)
#  316|           sel->name = stringNew(name);
#  317|->     sel->sy = height;
#  318|       sel->sx = width;
#  319|       if ((sel->data = create2dIntArray(height, width)) == NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def2003]
leptonica-1.87.0/src/sel1.c:318: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sel
#  316|           sel->name = stringNew(name);
#  317|       sel->sy = height;
#  318|->     sel->sx = width;
#  319|       if ((sel->data = create2dIntArray(height, width)) == NULL) {
#  320|           LEPT_FREE(sel->name);

Error: CPPCHECK_WARNING (CWE-476): [#def2004]
leptonica-1.87.0/src/sel1.c:319: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sel
#  317|       sel->sy = height;
#  318|       sel->sx = width;
#  319|->     if ((sel->data = create2dIntArray(height, width)) == NULL) {
#  320|           LEPT_FREE(sel->name);
#  321|           LEPT_FREE(sel);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2005]
leptonica-1.87.0/src/sel1.c:322:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2145:15: call_function: calling ‘selCreateFromColorPix’ from ‘selaCreateFromColorPixa’
#  320|           LEPT_FREE(sel->name);
#  321|           LEPT_FREE(sel);
#  322|->         return (SEL *)ERROR_PTR("data not allocated", __func__, NULL);
#  323|       }
#  324|   

Error: CPPCHECK_WARNING (CWE-476): [#def2006]
leptonica-1.87.0/src/sel1.c:375: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: csel
#  373|       csel = (SEL *)LEPT_CALLOC(1, sizeof(SEL));
#  374|       selGetParameters(sel, &sy, &sx, &cy, &cx);
#  375|->     csel->sy = sy;
#  376|       csel->sx = sx;
#  377|       csel->cy = cy;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2007]
leptonica-1.87.0/src/sel1.c:375:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘csel’
leptonica-1.87.0/src/sel1.c:365:1: enter_function: entry to ‘selCopy’
leptonica-1.87.0/src/sel1.c:373:19: acquire_memory: this call could return NULL
leptonica-1.87.0/src/sel1.c:374:5: call_function: calling ‘selGetParameters’ from ‘selCopy’
leptonica-1.87.0/src/sel1.c:374:5: return_function: returning to ‘selCopy’ from ‘selGetParameters’
leptonica-1.87.0/src/sel1.c:375:5: danger: ‘csel’ could be NULL: unchecked value from [(2)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/1)
#  373|       csel = (SEL *)LEPT_CALLOC(1, sizeof(SEL));
#  374|       selGetParameters(sel, &sy, &sx, &cy, &cx);
#  375|->     csel->sy = sy;
#  376|       csel->sx = sx;
#  377|       csel->cy = cy;

Error: CPPCHECK_WARNING (CWE-476): [#def2008]
leptonica-1.87.0/src/sel1.c:376: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: csel
#  374|       selGetParameters(sel, &sy, &sx, &cy, &cx);
#  375|       csel->sy = sy;
#  376|->     csel->sx = sx;
#  377|       csel->cy = cy;
#  378|       csel->cx = cx;

Error: CPPCHECK_WARNING (CWE-476): [#def2009]
leptonica-1.87.0/src/sel1.c:377: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: csel
#  375|       csel->sy = sy;
#  376|       csel->sx = sx;
#  377|->     csel->cy = cy;
#  378|       csel->cx = cx;
#  379|   

Error: CPPCHECK_WARNING (CWE-476): [#def2010]
leptonica-1.87.0/src/sel1.c:378: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: csel
#  376|       csel->sx = sx;
#  377|       csel->cy = cy;
#  378|->     csel->cx = cx;
#  379|   
#  380|       if ((csel->data = create2dIntArray(sy, sx)) == NULL) {

Error: CPPCHECK_WARNING (CWE-476): [#def2011]
leptonica-1.87.0/src/sel1.c:380: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: csel
#  378|       csel->cx = cx;
#  379|   
#  380|->     if ((csel->data = create2dIntArray(sy, sx)) == NULL) {
#  381|           LEPT_FREE(csel);
#  382|           return (SEL *)ERROR_PTR("sel data not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2012]
leptonica-1.87.0/src/sel1.c:387:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown> + (long unsigned int)j * 4’
leptonica-1.87.0/src/sel1.c:365:1: enter_function: entry to ‘selCopy’
leptonica-1.87.0/src/sel1.c:374:5: call_function: calling ‘selGetParameters’ from ‘selCopy’
leptonica-1.87.0/src/sel1.c:374:5: return_function: returning to ‘selCopy’ from ‘selGetParameters’
leptonica-1.87.0/src/sel1.c:380:23: call_function: calling ‘create2dIntArray’ from ‘selCopy’
leptonica-1.87.0/src/sel1.c:380:23: return_function: returning to ‘selCopy’ from ‘create2dIntArray’
leptonica-1.87.0/src/sel1.c:380:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:380:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:385:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:385:17: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:386:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:387:32: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:387:13: danger: ‘*<unknown> + (long unsigned int)j * 4’ could be NULL: unchecked value from [(31)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/30)
#  385|       for (i = 0; i < sy; i++)
#  386|           for (j = 0; j < sx; j++)
#  387|->             csel->data[i][j] = sel->data[i][j];
#  388|   
#  389|       if (sel->name)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2013]
leptonica-1.87.0/src/sel1.c:390:22: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:365:1: enter_function: entry to ‘selCopy’
leptonica-1.87.0/src/sel1.c:374:5: call_function: calling ‘selGetParameters’ from ‘selCopy’
leptonica-1.87.0/src/sel1.c:374:5: return_function: returning to ‘selCopy’ from ‘selGetParameters’
leptonica-1.87.0/src/sel1.c:380:23: call_function: calling ‘create2dIntArray’ from ‘selCopy’
leptonica-1.87.0/src/sel1.c:380:23: return_function: returning to ‘selCopy’ from ‘create2dIntArray’
leptonica-1.87.0/src/sel1.c:380:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:380:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:389:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:390:22: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:390:22: throw: if ‘stringNew’ throws an exception...
leptonica-1.87.0/src/sel1.c:390:22: danger: ‘<unknown>’ leaks here; was allocated at [(29)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/28)
#  388|   
#  389|       if (sel->name)
#  390|->         csel->name = stringNew(sel->name);
#  391|   
#  392|       return csel;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2014]
leptonica-1.87.0/src/sel1.c:390:22: warning[-Wanalyzer-malloc-leak]: leak of ‘csel’
leptonica-1.87.0/src/sel1.c:365:1: enter_function: entry to ‘selCopy’
leptonica-1.87.0/src/sel1.c:373:19: acquire_memory: allocated here
leptonica-1.87.0/src/sel1.c:374:5: call_function: calling ‘selGetParameters’ from ‘selCopy’
leptonica-1.87.0/src/sel1.c:374:5: return_function: returning to ‘selCopy’ from ‘selGetParameters’
leptonica-1.87.0/src/sel1.c:380:23: call_function: calling ‘create2dIntArray’ from ‘selCopy’
leptonica-1.87.0/src/sel1.c:380:23: return_function: returning to ‘selCopy’ from ‘create2dIntArray’
leptonica-1.87.0/src/sel1.c:380:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:380:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:389:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:390:22: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:390:22: throw: if ‘stringNew’ throws an exception...
leptonica-1.87.0/src/sel1.c:390:22: danger: ‘csel’ leaks here; was allocated at [(2)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/1)
#  388|   
#  389|       if (sel->name)
#  390|->         csel->name = stringNew(sel->name);
#  391|   
#  392|       return csel;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2015]
leptonica-1.87.0/src/sel1.c:511:9: warning[-Wanalyzer-malloc-leak]: leak of ‘selCreate(y + h,  x + w,  name)’
leptonica-1.87.0/src/sel1.c:1882:1: enter_function: entry to ‘selCreateFromPta’
leptonica-1.87.0/src/sel1.c:1891:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:1893:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1893:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1895:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1896:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1899:11: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1902:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1905:11: call_function: calling ‘selCreate’ from ‘selCreateFromPta’
leptonica-1.87.0/src/sel1.c:1905:11: return_function: returning to ‘selCreateFromPta’ from ‘selCreate’
leptonica-1.87.0/src/sel1.c:1906:5: call_function: calling ‘selSetOrigin’ from ‘selCreateFromPta’
leptonica-1.87.0/src/sel1.c:1906:5: return_function: returning to ‘selCreateFromPta’ from ‘selSetOrigin’
leptonica-1.87.0/src/sel1.c:1907:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1908:9: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1908:9: throw: if ‘ptaGetIPt’ throws an exception...
leptonica-1.87.0/src/sel1.c:511:9: danger: ‘selCreate(y + h,  x + w,  name)’ leaks here; was allocated at [(12)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/11)
#  509|   l_int32  **array;
#  510|   
#  511|->     if (sx <= 0 || sx > (l_int32)MaxKernelSize)
#  512|           return (l_int32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  513|       if (sy <= 0 || sy > (l_int32)MaxKernelSize)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2016]
leptonica-1.87.0/src/sel1.c:512:28: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2145:15: call_function: calling ‘selCreateFromColorPix’ from ‘selaCreateFromColorPixa’
#  510|   
#  511|       if (sx <= 0 || sx > (l_int32)MaxKernelSize)
#  512|->         return (l_int32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  513|       if (sy <= 0 || sy > (l_int32)MaxKernelSize)
#  514|           return (l_int32 **)ERROR_PTR("sy out of bounds", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2017]
leptonica-1.87.0/src/sel1.c:512:28: warning[-Wanalyzer-malloc-leak]: leak of ‘csel’
leptonica-1.87.0/src/sel1.c:365:1: enter_function: entry to ‘selCopy’
leptonica-1.87.0/src/sel1.c:373:19: acquire_memory: allocated here
leptonica-1.87.0/src/sel1.c:374:5: call_function: calling ‘selGetParameters’ from ‘selCopy’
leptonica-1.87.0/src/sel1.c:374:5: return_function: returning to ‘selCopy’ from ‘selGetParameters’
leptonica-1.87.0/src/sel1.c:380:23: call_function: calling ‘create2dIntArray’ from ‘selCopy’
#  510|   
#  511|       if (sx <= 0 || sx > (l_int32)MaxKernelSize)
#  512|->         return (l_int32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  513|       if (sy <= 0 || sy > (l_int32)MaxKernelSize)
#  514|           return (l_int32 **)ERROR_PTR("sy out of bounds", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2018]
leptonica-1.87.0/src/sel1.c:512:28: warning[-Wanalyzer-malloc-leak]: leak of ‘sela’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
#  510|   
#  511|       if (sx <= 0 || sx > (l_int32)MaxKernelSize)
#  512|->         return (l_int32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  513|       if (sy <= 0 || sy > (l_int32)MaxKernelSize)
#  514|           return (l_int32 **)ERROR_PTR("sy out of bounds", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2019]
leptonica-1.87.0/src/sel1.c:512:28: warning[-Wanalyzer-malloc-leak]: leak of ‘sel’
leptonica-1.87.0/src/sel1.c:410:1: enter_function: entry to ‘selCreateBrick’
leptonica-1.87.0/src/sel1.c:421:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:424:16: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:424:16: call_function: calling ‘selCreate’ from ‘selCreateBrick’
#  510|   
#  511|       if (sx <= 0 || sx > (l_int32)MaxKernelSize)
#  512|->         return (l_int32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  513|       if (sy <= 0 || sy > (l_int32)MaxKernelSize)
#  514|           return (l_int32 **)ERROR_PTR("sy out of bounds", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2020]
leptonica-1.87.0/src/sel1.c:514:28: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2145:15: call_function: calling ‘selCreateFromColorPix’ from ‘selaCreateFromColorPixa’
#  512|           return (l_int32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  513|       if (sy <= 0 || sy > (l_int32)MaxKernelSize)
#  514|->         return (l_int32 **)ERROR_PTR("sy out of bounds", __func__, NULL);
#  515|   
#  516|       array = (l_int32 **)LEPT_CALLOC(sy, sizeof(l_int32 *));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2021]
leptonica-1.87.0/src/sel1.c:514:28: warning[-Wanalyzer-malloc-leak]: leak of ‘csel’
leptonica-1.87.0/src/sel1.c:365:1: enter_function: entry to ‘selCopy’
leptonica-1.87.0/src/sel1.c:373:19: acquire_memory: allocated here
leptonica-1.87.0/src/sel1.c:374:5: call_function: calling ‘selGetParameters’ from ‘selCopy’
leptonica-1.87.0/src/sel1.c:374:5: return_function: returning to ‘selCopy’ from ‘selGetParameters’
leptonica-1.87.0/src/sel1.c:380:23: call_function: calling ‘create2dIntArray’ from ‘selCopy’
#  512|           return (l_int32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  513|       if (sy <= 0 || sy > (l_int32)MaxKernelSize)
#  514|->         return (l_int32 **)ERROR_PTR("sy out of bounds", __func__, NULL);
#  515|   
#  516|       array = (l_int32 **)LEPT_CALLOC(sy, sizeof(l_int32 *));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2022]
leptonica-1.87.0/src/sel1.c:514:28: warning[-Wanalyzer-malloc-leak]: leak of ‘sela’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
#  512|           return (l_int32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  513|       if (sy <= 0 || sy > (l_int32)MaxKernelSize)
#  514|->         return (l_int32 **)ERROR_PTR("sy out of bounds", __func__, NULL);
#  515|   
#  516|       array = (l_int32 **)LEPT_CALLOC(sy, sizeof(l_int32 *));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2023]
leptonica-1.87.0/src/sel1.c:514:28: warning[-Wanalyzer-malloc-leak]: leak of ‘sel’
leptonica-1.87.0/src/sel1.c:410:1: enter_function: entry to ‘selCreateBrick’
leptonica-1.87.0/src/sel1.c:421:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:424:16: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:424:16: call_function: calling ‘selCreate’ from ‘selCreateBrick’
#  512|           return (l_int32 **)ERROR_PTR("sx out of bounds", __func__, NULL);
#  513|       if (sy <= 0 || sy > (l_int32)MaxKernelSize)
#  514|->         return (l_int32 **)ERROR_PTR("sy out of bounds", __func__, NULL);
#  515|   
#  516|       array = (l_int32 **)LEPT_CALLOC(sy, sizeof(l_int32 *));

Error: CPPCHECK_WARNING (CWE-476): [#def2024]
leptonica-1.87.0/src/sel1.c:518: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: array
#  516|       array = (l_int32 **)LEPT_CALLOC(sy, sizeof(l_int32 *));
#  517|       for (i = 0; i < sy; i++)
#  518|->         array[i] = (l_int32 *)LEPT_CALLOC(sx, sizeof(l_int32));
#  519|       return array;
#  520|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2025]
leptonica-1.87.0/src/sel1.c:518:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘array’
leptonica-1.87.0/src/sel1.c:513:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:516:25: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:516:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/sel1.c:517:17: branch_true: following ‘true’ branch (when ‘sy > i’)...
leptonica-1.87.0/src/sel1.c:518:31: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:518:9: danger: ‘array + (long unsigned int)i * 8’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/2)
#  516|       array = (l_int32 **)LEPT_CALLOC(sy, sizeof(l_int32 *));
#  517|       for (i = 0; i < sy; i++)
#  518|->         array[i] = (l_int32 *)LEPT_CALLOC(sx, sizeof(l_int32));
#  519|       return array;
#  520|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2026]
leptonica-1.87.0/src/sel1.c:690:12: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2041:1: enter_function: entry to ‘selCreateFromColorPix’
leptonica-1.87.0/src/sel1.c:2058:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2061:16: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2061:16: call_function: calling ‘selCreate’ from ‘selCreateFromColorPix’
leptonica-1.87.0/src/sel1.c:2061:16: return_function: returning to ‘selCreateFromColorPix’ from ‘selCreate’
leptonica-1.87.0/src/sel1.c:2061:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2063:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2063:5: call_function: calling ‘selSetOrigin’ from ‘selCreateFromColorPix’
leptonica-1.87.0/src/sel1.c:2063:5: return_function: returning to ‘selCreateFromColorPix’ from ‘selSetOrigin’
leptonica-1.87.0/src/sel1.c:2064:5: call_function: calling ‘selSetName’ from ‘selCreateFromColorPix’
#  688|           return ERROR_INT("sel not defined", __func__, 1);
#  689|   
#  690|->     return stringReplace(&sel->name, name);
#  691|   }
#  692|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2027]
leptonica-1.87.0/src/sel1.c:690:12: warning[-Wanalyzer-malloc-leak]: leak of ‘sel’
leptonica-1.87.0/src/sel1.c:2041:1: enter_function: entry to ‘selCreateFromColorPix’
leptonica-1.87.0/src/sel1.c:2058:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2061:16: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2061:16: call_function: calling ‘selCreate’ from ‘selCreateFromColorPix’
leptonica-1.87.0/src/sel1.c:2061:16: return_function: returning to ‘selCreateFromColorPix’ from ‘selCreate’
leptonica-1.87.0/src/sel1.c:2061:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2063:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2063:5: call_function: calling ‘selSetOrigin’ from ‘selCreateFromColorPix’
leptonica-1.87.0/src/sel1.c:2063:5: return_function: returning to ‘selCreateFromColorPix’ from ‘selSetOrigin’
leptonica-1.87.0/src/sel1.c:2064:5: call_function: calling ‘selSetName’ from ‘selCreateFromColorPix’
#  688|           return ERROR_INT("sel not defined", __func__, 1);
#  689|   
#  690|->     return stringReplace(&sel->name, name);
#  691|   }
#  692|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2028]
leptonica-1.87.0/src/sel1.c:827:16: warning[-Wanalyzer-malloc-leak]: leak of ‘csel’
leptonica-1.87.0/src/sel1.c:365:1: enter_function: entry to ‘selCopy’
leptonica-1.87.0/src/sel1.c:373:19: acquire_memory: allocated here
leptonica-1.87.0/src/sel1.c:374:5: call_function: calling ‘selGetParameters’ from ‘selCopy’
#  825|       if (pcx) *pcx = 0;
#  826|       if (!sel)
#  827|->         return ERROR_INT("sel not defined", __func__, 1);
#  828|       if (psy) *psy = sel->sy;
#  829|       if (psx) *psx = sel->sx;

Error: COMPILER_WARNING: [#def2029]
leptonica-1.87.0/src/sel1.c: scope_hint: In function ‘selReadStream’
leptonica-1.87.0/src/sel1.c:1354:41: warning[-Wunused-but-set-variable=]: variable ‘ignore’ set but not used
# 1354 | l_int32  sy, sx, cy, cx, i, j, version, ignore;
#      |                                         ^~~~~~
# 1352|   char     selname[256];
# 1353|   char     linebuf[256];
# 1354|-> l_int32  sy, sx, cy, cx, i, j, version, ignore;
# 1355|   SEL     *sel;
# 1356|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2030]
leptonica-1.87.0/src/sel1.c:1358:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
# 1356|   
# 1357|       if (!fp)
# 1358|->         return (SEL *)ERROR_PTR("stream not defined", __func__, NULL);
# 1359|   
# 1360|       if (fscanf(fp, "  Sel Version %d\n", &version) != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2031]
leptonica-1.87.0/src/sel1.c:1358:23: warning[-Wanalyzer-malloc-leak]: leak of ‘sela’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
# 1356|   
# 1357|       if (!fp)
# 1358|->         return (SEL *)ERROR_PTR("stream not defined", __func__, NULL);
# 1359|   
# 1360|       if (fscanf(fp, "  Sel Version %d\n", &version) != 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2032]
leptonica-1.87.0/src/sel1.c:1361:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
# 1359|   
# 1360|       if (fscanf(fp, "  Sel Version %d\n", &version) != 1)
# 1361|->         return (SEL *)ERROR_PTR("not a sel file", __func__, NULL);
# 1362|       if (version != SEL_VERSION_NUMBER)
# 1363|           return (SEL *)ERROR_PTR("invalid sel version", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2033]
leptonica-1.87.0/src/sel1.c:1361:23: warning[-Wanalyzer-malloc-leak]: leak of ‘sela’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
# 1359|   
# 1360|       if (fscanf(fp, "  Sel Version %d\n", &version) != 1)
# 1361|->         return (SEL *)ERROR_PTR("not a sel file", __func__, NULL);
# 1362|       if (version != SEL_VERSION_NUMBER)
# 1363|           return (SEL *)ERROR_PTR("invalid sel version", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2034]
leptonica-1.87.0/src/sel1.c:1363:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
# 1361|           return (SEL *)ERROR_PTR("not a sel file", __func__, NULL);
# 1362|       if (version != SEL_VERSION_NUMBER)
# 1363|->         return (SEL *)ERROR_PTR("invalid sel version", __func__, NULL);
# 1364|   
# 1365|       if (fgets(linebuf, sizeof(linebuf), fp) == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2035]
leptonica-1.87.0/src/sel1.c:1363:23: warning[-Wanalyzer-malloc-leak]: leak of ‘sela’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
# 1361|           return (SEL *)ERROR_PTR("not a sel file", __func__, NULL);
# 1362|       if (version != SEL_VERSION_NUMBER)
# 1363|->         return (SEL *)ERROR_PTR("invalid sel version", __func__, NULL);
# 1364|   
# 1365|       if (fgets(linebuf, sizeof(linebuf), fp) == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2036]
leptonica-1.87.0/src/sel1.c:1366:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
# 1364|   
# 1365|       if (fgets(linebuf, sizeof(linebuf), fp) == NULL)
# 1366|->         return (SEL *)ERROR_PTR("error reading into linebuf", __func__, NULL);
# 1367|       sscanf(linebuf, "  ------  %200s  ------", selname);
# 1368|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2037]
leptonica-1.87.0/src/sel1.c:1366:23: warning[-Wanalyzer-malloc-leak]: leak of ‘sela’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
# 1364|   
# 1365|       if (fgets(linebuf, sizeof(linebuf), fp) == NULL)
# 1366|->         return (SEL *)ERROR_PTR("error reading into linebuf", __func__, NULL);
# 1367|       sscanf(linebuf, "  ------  %200s  ------", selname);
# 1368|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2038]
leptonica-1.87.0/src/sel1.c:1371:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
# 1369|       if (fscanf(fp, "  sy = %d, sx = %d, cy = %d, cx = %d\n",
# 1370|                  &sy, &sx, &cy, &cx) != 4)
# 1371|->         return (SEL *)ERROR_PTR("dimensions not read", __func__, NULL);
# 1372|   
# 1373|       if ((sel = selCreate(sy, sx, selname)) == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2039]
leptonica-1.87.0/src/sel1.c:1371:23: warning[-Wanalyzer-malloc-leak]: leak of ‘sela’
leptonica-1.87.0/src/sel1.c:1284:1: enter_function: entry to ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1293:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1295:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1295:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1297:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1297:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1300:17: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1300:17: call_function: calling ‘selaCreate’ from ‘selaReadStream’
leptonica-1.87.0/src/sel1.c:1300:17: return_function: returning to ‘selaReadStream’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:1300:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1302:5: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1304:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1305:20: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1305:20: call_function: calling ‘selReadStream’ from ‘selaReadStream’
# 1369|       if (fscanf(fp, "  sy = %d, sx = %d, cy = %d, cx = %d\n",
# 1370|                  &sy, &sx, &cy, &cx) != 4)
# 1371|->         return (SEL *)ERROR_PTR("dimensions not read", __func__, NULL);
# 1372|   
# 1373|       if ((sel = selCreate(sy, sx, selname)) == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2040]
leptonica-1.87.0/src/sel1.c:1908:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:1882:1: enter_function: entry to ‘selCreateFromPta’
leptonica-1.87.0/src/sel1.c:1891:8: branch_false: following ‘false’ branch (when ‘pta’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:1893:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1893:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1895:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1896:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1899:11: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:1902:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:1905:11: call_function: calling ‘selCreate’ from ‘selCreateFromPta’
leptonica-1.87.0/src/sel1.c:1905:11: return_function: returning to ‘selCreateFromPta’ from ‘selCreate’
leptonica-1.87.0/src/sel1.c:1906:5: call_function: calling ‘selSetOrigin’ from ‘selCreateFromPta’
leptonica-1.87.0/src/sel1.c:1906:5: return_function: returning to ‘selCreateFromPta’ from ‘selSetOrigin’
leptonica-1.87.0/src/sel1.c:1907:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:1908:9: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:1908:9: throw: if ‘ptaGetIPt’ throws an exception...
leptonica-1.87.0/src/sel1.c:1908:9: danger: ‘<unknown>’ leaks here; was allocated at [(22)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/21)
# 1906|       selSetOrigin(sel, cy, cx);
# 1907|       for (i = 0; i < n; i++) {
# 1908|->         ptaGetIPt(pta, i, &x, &y);
# 1909|           selSetElement(sel, y, x, SEL_HIT);
# 1910|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2041]
leptonica-1.87.0/src/sel1.c:2051:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2145:15: call_function: calling ‘selCreateFromColorPix’ from ‘selaCreateFromColorPixa’
# 2049|   
# 2050|       if (!pixs)
# 2051|->         return (SEL *)ERROR_PTR("pixs not defined", __func__, NULL);
# 2052|   
# 2053|       hascolor = FALSE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2042]
leptonica-1.87.0/src/sel1.c:2054:12: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2145:15: call_function: calling ‘selCreateFromColorPix’ from ‘selaCreateFromColorPixa’
# 2052|   
# 2053|       hascolor = FALSE;
# 2054|->     cmap = pixGetColormap(pixs);
# 2055|       if (cmap)
# 2056|           pixcmapHasColor(cmap, &hascolor);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2043]
leptonica-1.87.0/src/sel1.c:2056:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2145:15: call_function: calling ‘selCreateFromColorPix’ from ‘selaCreateFromColorPixa’
# 2054|       cmap = pixGetColormap(pixs);
# 2055|       if (cmap)
# 2056|->         pixcmapHasColor(cmap, &hascolor);
# 2057|       pixGetDimensions(pixs, &w, &h, &d);
# 2058|       if (hascolor == FALSE && d != 32)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2044]
leptonica-1.87.0/src/sel1.c:2057:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2145:15: call_function: calling ‘selCreateFromColorPix’ from ‘selaCreateFromColorPixa’
# 2055|       if (cmap)
# 2056|           pixcmapHasColor(cmap, &hascolor);
# 2057|->     pixGetDimensions(pixs, &w, &h, &d);
# 2058|       if (hascolor == FALSE && d != 32)
# 2059|           return (SEL *)ERROR_PTR("pixs has no color", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2045]
leptonica-1.87.0/src/sel1.c:2059:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2145:15: call_function: calling ‘selCreateFromColorPix’ from ‘selaCreateFromColorPixa’
# 2057|       pixGetDimensions(pixs, &w, &h, &d);
# 2058|       if (hascolor == FALSE && d != 32)
# 2059|->         return (SEL *)ERROR_PTR("pixs has no color", __func__, NULL);
# 2060|   
# 2061|       if ((sel = selCreate (h, w, NULL)) == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2046]
leptonica-1.87.0/src/sel1.c:2143:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2143:15: throw: if ‘pixaGetPix’ throws an exception...
leptonica-1.87.0/src/sel1.c:2143:15: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/54/codeFlows/0/threadFlows/0/locations/7)
# 2141|           return (SELA *)ERROR_PTR("sela not allocated", __func__, NULL);
# 2142|       for (i = 0; i < n; i++) {
# 2143|->         pix = pixaGetPix(pixa, i, L_CLONE);
# 2144|           str = sarrayGetString(sa, i, L_NOCOPY);
# 2145|           sel = selCreateFromColorPix(pix, str);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2047]
leptonica-1.87.0/src/sel1.c:2144:15: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/sel1.c:2125:1: enter_function: entry to ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2134:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2136:8: branch_false: following ‘false’ branch (when ‘sa’ is non-NULL)...
leptonica-1.87.0/src/sel1.c:2139:9: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2140:17: call_function: calling ‘selaCreate’ from ‘selaCreateFromColorPixa’
leptonica-1.87.0/src/sel1.c:2140:17: return_function: returning to ‘selaCreateFromColorPixa’ from ‘selaCreate’
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sel1.c:2140:8: branch_false: ...to here
leptonica-1.87.0/src/sel1.c:2142:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sel1.c:2143:15: branch_true: ...to here
leptonica-1.87.0/src/sel1.c:2144:15: throw: if ‘sarrayGetString’ throws an exception...
leptonica-1.87.0/src/sel1.c:2144:15: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/7)
# 2142|       for (i = 0; i < n; i++) {
# 2143|           pix = pixaGetPix(pixa, i, L_CLONE);
# 2144|->         str = sarrayGetString(sa, i, L_NOCOPY);
# 2145|           sel = selCreateFromColorPix(pix, str);
# 2146|           selaAddSel(sela, sel, NULL, L_INSERT);

Error: CPPCHECK_WARNING (CWE-457): [#def2048]
leptonica-1.87.0/src/selgen.c:766: warning[uninitvar]: Uninitialized variable: runlen
#  764|           }
#  765|       }
#  766|->     numaAddNumber(numa, runlen);  /* append last run */
#  767|   
#  768|       ptaDestroy(&pta);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def2049]
leptonica-1.87.0/src/selgen.c:766:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘runlen’
leptonica-1.87.0/src/selgen.c:719:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/selgen.c:721:9: branch_false: ...to here
leptonica-1.87.0/src/selgen.c:721:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/selgen.c:724:9: branch_false: ...to here
leptonica-1.87.0/src/selgen.c:726:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/selgen.c:728:9: branch_false: ...to here
leptonica-1.87.0/src/selgen.c:728:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/selgen.c:730:9: branch_false: ...to here
leptonica-1.87.0/src/selgen.c:730:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/selgen.c:732:9: branch_false: ...to here
leptonica-1.87.0/src/selgen.c:732:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/selgen.c:735:16: branch_false: ...to here
leptonica-1.87.0/src/selgen.c:735:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/selgen.c:737:17: branch_false: ...to here
leptonica-1.87.0/src/selgen.c:737:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/selgen.c:741:17: branch_false: ...to here
leptonica-1.87.0/src/selgen.c:741:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/selgen.c:741:8: branch_false: ...to here
leptonica-1.87.0/src/selgen.c:746:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/selgen.c:766:5: branch_false: ...to here
leptonica-1.87.0/src/selgen.c:766:5: danger: use of uninitialized value ‘runlen’ here
#  764|           }
#  765|       }
#  766|->     numaAddNumber(numa, runlen);  /* append last run */
#  767|   
#  768|       ptaDestroy(&pta);

Error: COMPILER_WARNING (CWE-457): [#def2050]
leptonica-1.87.0/src/selgen.c: scope_hint: In function ‘pixGetRunsOnLine’
leptonica-1.87.0/src/selgen.c:766:5: warning[-Wmaybe-uninitialized]: ‘runlen’ may be used uninitialized
#  766 |     numaAddNumber(numa, runlen);  /* append last run */
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/selgen.c:714:14: note: ‘runlen’ was declared here
#  714 | l_int32   i, runlen, preval;
#      |              ^~~~~~
#  764|           }
#  765|       }
#  766|->     numaAddNumber(numa, runlen);  /* append last run */
#  767|   
#  768|       ptaDestroy(&pta);

Error: CPPCHECK_WARNING (CWE-476): [#def2051]
leptonica-1.87.0/src/stack.c:90: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lstack
#   88|   
#   89|       lstack = (L_STACK *)LEPT_CALLOC(1, sizeof(L_STACK));
#   90|->     lstack->array = (void **)LEPT_CALLOC(n, sizeof(void *));
#   91|       if (!lstack->array) {
#   92|           lstackDestroy(&lstack, FALSE);

Error: CPPCHECK_WARNING (CWE-476): [#def2052]
leptonica-1.87.0/src/stack.c:91: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lstack
#   89|       lstack = (L_STACK *)LEPT_CALLOC(1, sizeof(L_STACK));
#   90|       lstack->array = (void **)LEPT_CALLOC(n, sizeof(void *));
#   91|->     if (!lstack->array) {
#   92|           lstackDestroy(&lstack, FALSE);
#   93|           return (L_STACK *)ERROR_PTR("lstack array not made", __func__, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2053]
leptonica-1.87.0/src/stringcode.c:169:25: warning[-Wanalyzer-malloc-leak]: leak of ‘strcode’
leptonica-1.87.0/src/stringcode.c:165:33: acquire_memory: allocated here
leptonica-1.87.0/src/stringcode.c:165:8: branch_false: following ‘false’ branch (when ‘strcode’ is non-NULL)...
leptonica-1.87.0/src/stringcode.c:168:5: branch_false: ...to here
leptonica-1.87.0/src/stringcode.c:169:25: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/stringcode.c:169:25: danger: ‘strcode’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  167|   
#  168|       strcode->fileno = fileno;
#  169|->     strcode->function = sarrayCreate(0);
#  170|       strcode->data = sarrayCreate(0);
#  171|       strcode->descr = sarrayCreate(0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2054]
leptonica-1.87.0/src/stringcode.c:170:21: warning[-Wanalyzer-malloc-leak]: leak of ‘strcode’
leptonica-1.87.0/src/stringcode.c:165:33: acquire_memory: allocated here
leptonica-1.87.0/src/stringcode.c:165:8: branch_false: following ‘false’ branch (when ‘strcode’ is non-NULL)...
leptonica-1.87.0/src/stringcode.c:168:5: branch_false: ...to here
leptonica-1.87.0/src/stringcode.c:170:21: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/stringcode.c:170:21: danger: ‘strcode’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  168|       strcode->fileno = fileno;
#  169|       strcode->function = sarrayCreate(0);
#  170|->     strcode->data = sarrayCreate(0);
#  171|       strcode->descr = sarrayCreate(0);
#  172|       return strcode;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2055]
leptonica-1.87.0/src/stringcode.c:171:22: warning[-Wanalyzer-malloc-leak]: leak of ‘strcode’
leptonica-1.87.0/src/stringcode.c:165:33: acquire_memory: allocated here
leptonica-1.87.0/src/stringcode.c:165:8: branch_false: following ‘false’ branch (when ‘strcode’ is non-NULL)...
leptonica-1.87.0/src/stringcode.c:168:5: branch_false: ...to here
leptonica-1.87.0/src/stringcode.c:171:22: throw: if ‘sarrayCreate’ throws an exception...
leptonica-1.87.0/src/stringcode.c:171:22: danger: ‘strcode’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  169|       strcode->function = sarrayCreate(0);
#  170|       strcode->data = sarrayCreate(0);
#  171|->     strcode->descr = sarrayCreate(0);
#  172|       return strcode;
#  173|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2056]
leptonica-1.87.0/src/stringcode.c:250:17: warning[-Wanalyzer-malloc-leak]: leak of ‘strcode’
leptonica-1.87.0/src/stringcode.c:221:1: enter_function: entry to ‘strcodeCreateFromFile’
leptonica-1.87.0/src/stringcode.c:233:8: branch_false: following ‘false’ branch (when ‘filein’ is non-NULL)...
leptonica-1.87.0/src/stringcode.c:236:17: branch_false: ...to here
leptonica-1.87.0/src/stringcode.c:236:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/stringcode.c:238:10: branch_false: ...to here
leptonica-1.87.0/src/stringcode.c:240:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/stringcode.c:242:14: branch_false: ...to here
leptonica-1.87.0/src/stringcode.c:242:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/stringcode.c:247:15: branch_false: ...to here
leptonica-1.87.0/src/stringcode.c:247:15: call_function: calling ‘strcodeCreate’ from ‘strcodeCreateFromFile’
leptonica-1.87.0/src/stringcode.c:247:15: return_function: returning to ‘strcodeCreateFromFile’ from ‘strcodeCreate’
leptonica-1.87.0/src/stringcode.c:249:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/stringcode.c:250:17: branch_true: ...to here
leptonica-1.87.0/src/stringcode.c:250:17: throw: if ‘sarrayGetString’ throws an exception...
leptonica-1.87.0/src/stringcode.c:250:17: danger: ‘strcode’ leaks here; was allocated at [(12)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/11)
#  248|   
#  249|       for (i = 0; i < n; i++) {
#  250|->         fname = sarrayGetString(sa, i, L_NOCOPY);
#  251|           if (fname[0] == '#') continue;
#  252|           if (l_getIndexFromFile(fname, &index)) {

Error: CPPCHECK_WARNING (CWE-457): [#def2057]
leptonica-1.87.0/src/strokes.c:177: warning[uninitvar]: Uninitialized variable: ratio
#  175|            * than the average width. */
#  176|       extra = (i < n - 1) ? fa[i + 1] / fa[1] : 0;
#  177|->     width2 = 2.0f * (i - 1.0f + ratio + extra);
#  178|       lept_stderr("width1 = %5.2f, width2 = %5.2f\n", width1, width2);
#  179|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def2058]
leptonica-1.87.0/src/strokes.c:177:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘ratio’
leptonica-1.87.0/src/strokes.c:125:1: enter_function: entry to ‘pixFindStrokeWidth’
leptonica-1.87.0/src/strokes.c:138:8: branch_false: following ‘false’ branch (when ‘pwidth’ is non-NULL)...
leptonica-1.87.0/src/strokes.c:140:5: branch_false: ...to here
leptonica-1.87.0/src/strokes.c:141:8: branch_false: following ‘false’ branch (when ‘pixs’ is non-NULL)...
leptonica-1.87.0/src/strokes.c:144:11: branch_false: ...to here
leptonica-1.87.0/src/strokes.c:151:5: call_function: calling ‘pixFindStrokeLength’ from ‘pixFindStrokeWidth’
leptonica-1.87.0/src/strokes.c:151:5: return_function: returning to ‘pixFindStrokeWidth’ from ‘pixFindStrokeLength’
leptonica-1.87.0/src/strokes.c:168:21: branch_false: following ‘false’ branch (when ‘i <= 0’)...
leptonica-1.87.0/src/strokes.c:176:13: branch_false: ...to here
leptonica-1.87.0/src/strokes.c:176:13: branch_false: following ‘false’ branch (when ‘i >= i’)...
leptonica-1.87.0/src/strokes.c:177:22: branch_false: ...to here
leptonica-1.87.0/src/strokes.c:177:22: danger: use of uninitialized value ‘ratio’ here
#  175|            * than the average width. */
#  176|       extra = (i < n - 1) ? fa[i + 1] / fa[1] : 0;
#  177|->     width2 = 2.0f * (i - 1.0f + ratio + extra);
#  178|       lept_stderr("width1 = %5.2f, width2 = %5.2f\n", width1, width2);
#  179|   

Error: COMPILER_WARNING (CWE-457): [#def2059]
leptonica-1.87.0/src/strokes.c: scope_hint: In function ‘pixFindStrokeWidth’
leptonica-1.87.0/src/strokes.c:177:31: warning[-Wmaybe-uninitialized]: ‘ratio’ may be used uninitialized
#  177 |     width2 = 2.0f * (i - 1.0f + ratio + extra);
#      |                      ~~~~~~~~~^~~~~~~
leptonica-1.87.0/src/strokes.c:133:29: note: ‘ratio’ was declared here
#  133 | l_float32   width1, width2, ratio, extra;
#      |                             ^~~~~
#  175|            * than the average width. */
#  176|       extra = (i < n - 1) ? fa[i + 1] / fa[1] : 0;
#  177|->     width2 = 2.0f * (i - 1.0f + ratio + extra);
#  178|       lept_stderr("width1 = %5.2f, width2 = %5.2f\n", width1, width2);
#  179|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2060]
leptonica-1.87.0/src/sudoku.c:223:15: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/sudoku.c:196:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:198:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:212:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:221:24: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:221:24: acquire_memory: allocated here
leptonica-1.87.0/src/sudoku.c:222:28: branch_true: following ‘true’ branch (when ‘i != 9’)...
leptonica-1.87.0/src/sudoku.c:223:15: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:223:15: throw: if ‘sarrayGetString’ throws an exception...
leptonica-1.87.0/src/sudoku.c:223:15: danger: ‘array’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  221|       array = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  222|       for (i = 0, index = 0; i < 9; i++) {
#  223|->         str = sarrayGetString(sa2, i, L_NOCOPY);
#  224|           saline = sarrayCreateWordsFromString(str);
#  225|           if (sarrayGetCount(saline) != 9) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2061]
leptonica-1.87.0/src/sudoku.c:224:18: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/sudoku.c:196:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:198:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:212:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:221:24: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:221:24: acquire_memory: allocated here
leptonica-1.87.0/src/sudoku.c:222:28: branch_true: following ‘true’ branch (when ‘i != 9’)...
leptonica-1.87.0/src/sudoku.c:223:15: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:224:18: throw: if ‘sarrayCreateWordsFromString’ throws an exception...
leptonica-1.87.0/src/sudoku.c:224:18: danger: ‘array’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  222|       for (i = 0, index = 0; i < 9; i++) {
#  223|           str = sarrayGetString(sa2, i, L_NOCOPY);
#  224|->         saline = sarrayCreateWordsFromString(str);
#  225|           if (sarrayGetCount(saline) != 9) {
#  226|               error = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2062]
leptonica-1.87.0/src/sudoku.c:225:13: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/sudoku.c:196:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:198:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:212:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:221:24: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:221:24: acquire_memory: allocated here
leptonica-1.87.0/src/sudoku.c:222:28: branch_true: following ‘true’ branch (when ‘i != 9’)...
leptonica-1.87.0/src/sudoku.c:223:15: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:225:13: throw: if ‘sarrayGetCount’ throws an exception...
leptonica-1.87.0/src/sudoku.c:225:13: danger: ‘array’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  223|           str = sarrayGetString(sa2, i, L_NOCOPY);
#  224|           saline = sarrayCreateWordsFromString(str);
#  225|->         if (sarrayGetCount(saline) != 9) {
#  226|               error = TRUE;
#  227|               sarrayDestroy(&saline);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2063]
leptonica-1.87.0/src/sudoku.c:227:13: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/sudoku.c:196:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:198:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:212:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:221:24: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:221:24: acquire_memory: allocated here
leptonica-1.87.0/src/sudoku.c:222:28: branch_true: following ‘true’ branch (when ‘i != 9’)...
leptonica-1.87.0/src/sudoku.c:223:15: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:225:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sudoku.c:227:13: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:227:13: throw: if ‘sarrayDestroy’ throws an exception...
leptonica-1.87.0/src/sudoku.c:227:13: danger: ‘array’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  225|           if (sarrayGetCount(saline) != 9) {
#  226|               error = TRUE;
#  227|->             sarrayDestroy(&saline);
#  228|               break;
#  229|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2064]
leptonica-1.87.0/src/sudoku.c:231:20: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/sudoku.c:196:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:198:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:212:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:221:24: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:221:24: acquire_memory: allocated here
leptonica-1.87.0/src/sudoku.c:222:28: branch_true: following ‘true’ branch (when ‘i != 9’)...
leptonica-1.87.0/src/sudoku.c:223:15: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:225:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:225:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:230:21: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/sudoku.c:231:20: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:231:20: throw: if ‘sarrayGetString’ throws an exception...
leptonica-1.87.0/src/sudoku.c:231:20: danger: ‘array’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  229|           }
#  230|           for (j = 0; j < 9; j++) {
#  231|->             strj = sarrayGetString(saline, j, L_NOCOPY);
#  232|               if (sscanf(strj, "%d", &val) != 1)
#  233|                   error = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2065]
leptonica-1.87.0/src/sudoku.c:235:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘array’
leptonica-1.87.0/src/sudoku.c:196:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:198:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:212:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:221:24: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:221:24: acquire_memory: this call could return NULL
leptonica-1.87.0/src/sudoku.c:222:28: branch_true: following ‘true’ branch (when ‘i != 9’)...
leptonica-1.87.0/src/sudoku.c:223:15: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:225:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:225:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:230:21: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/sudoku.c:231:20: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:235:17: danger: ‘array + (long unsigned int)index * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  233|                   error = TRUE;
#  234|               else
#  235|->                 array[index++] = val;
#  236|           }
#  237|           sarrayDestroy(&saline);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2066]
leptonica-1.87.0/src/sudoku.c:237:9: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/sudoku.c:196:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:198:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:212:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:221:24: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:221:24: acquire_memory: allocated here
leptonica-1.87.0/src/sudoku.c:222:28: branch_true: following ‘true’ branch (when ‘i != 9’)...
leptonica-1.87.0/src/sudoku.c:223:15: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:225:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:225:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:230:21: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/sudoku.c:231:20: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:232:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sudoku.c:230:28: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:230:21: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/sudoku.c:231:20: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:232:16: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/sudoku.c:230:28: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:230:21: branch_false: following ‘false’ branch (when ‘j == 9’)...
leptonica-1.87.0/src/sudoku.c:237:9: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:237:9: throw: if ‘sarrayDestroy’ throws an exception...
leptonica-1.87.0/src/sudoku.c:237:9: danger: ‘array’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  235|                   array[index++] = val;
#  236|           }
#  237|->         sarrayDestroy(&saline);
#  238|           if (error) break;
#  239|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2067]
leptonica-1.87.0/src/sudoku.c:240:5: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
leptonica-1.87.0/src/sudoku.c:196:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:198:12: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:212:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:221:24: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:221:24: acquire_memory: allocated here
leptonica-1.87.0/src/sudoku.c:222:28: branch_true: following ‘true’ branch (when ‘i != 9’)...
leptonica-1.87.0/src/sudoku.c:223:15: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:240:5: throw: if ‘sarrayDestroy’ throws an exception...
leptonica-1.87.0/src/sudoku.c:240:5: danger: ‘array’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  238|           if (error) break;
#  239|       }
#  240|->     sarrayDestroy(&sa2);
#  241|   
#  242|       if (error) {

Error: CPPCHECK_WARNING (CWE-476): [#def2068]
leptonica-1.87.0/src/sudoku.c:313: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sud
#  311|       locs_index = 0;  /* into locs array */
#  312|       sud = (L_SUDOKU *)LEPT_CALLOC(1, sizeof(L_SUDOKU));
#  313|->     sud->locs = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  314|       sud->init = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  315|       sud->state = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2069]
leptonica-1.87.0/src/sudoku.c:313:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘sud’
leptonica-1.87.0/src/sudoku.c:312:23: acquire_memory: this call could return NULL
leptonica-1.87.0/src/sudoku.c:313:5: danger: ‘sud’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  311|       locs_index = 0;  /* into locs array */
#  312|       sud = (L_SUDOKU *)LEPT_CALLOC(1, sizeof(L_SUDOKU));
#  313|->     sud->locs = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  314|       sud->init = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  315|       sud->state = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));

Error: CPPCHECK_WARNING (CWE-476): [#def2070]
leptonica-1.87.0/src/sudoku.c:314: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sud
#  312|       sud = (L_SUDOKU *)LEPT_CALLOC(1, sizeof(L_SUDOKU));
#  313|       sud->locs = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  314|->     sud->init = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  315|       sud->state = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  316|       for (i = 0; i < 81; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def2071]
leptonica-1.87.0/src/sudoku.c:315: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sud
#  313|       sud->locs = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  314|       sud->init = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  315|->     sud->state = (l_int32 *)LEPT_CALLOC(81, sizeof(l_int32));
#  316|       for (i = 0; i < 81; i++) {
#  317|           val = array[i];

Error: CPPCHECK_WARNING (CWE-476): [#def2072]
leptonica-1.87.0/src/sudoku.c:318: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sud
#  316|       for (i = 0; i < 81; i++) {
#  317|           val = array[i];
#  318|->         sud->init[i] = val;
#  319|           sud->state[i] = val;
#  320|           if (val == 0)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2073]
leptonica-1.87.0/src/sudoku.c:318:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(81, 4)’
leptonica-1.87.0/src/sudoku.c:314:28: acquire_memory: this call could return NULL
leptonica-1.87.0/src/sudoku.c:316:17: branch_true: following ‘true’ branch (when ‘i != 81’)...
leptonica-1.87.0/src/sudoku.c:317:20: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:318:9: danger: ‘calloc(81, 4) + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  316|       for (i = 0; i < 81; i++) {
#  317|           val = array[i];
#  318|->         sud->init[i] = val;
#  319|           sud->state[i] = val;
#  320|           if (val == 0)

Error: CPPCHECK_WARNING (CWE-476): [#def2074]
leptonica-1.87.0/src/sudoku.c:319: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sud
#  317|           val = array[i];
#  318|           sud->init[i] = val;
#  319|->         sud->state[i] = val;
#  320|           if (val == 0)
#  321|               sud->locs[locs_index++] = i;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2075]
leptonica-1.87.0/src/sudoku.c:319:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(81, 4)’
leptonica-1.87.0/src/sudoku.c:315:29: acquire_memory: this call could return NULL
leptonica-1.87.0/src/sudoku.c:316:17: branch_true: following ‘true’ branch (when ‘i != 81’)...
leptonica-1.87.0/src/sudoku.c:317:20: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:319:9: danger: ‘calloc(81, 4) + (long unsigned int)i * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  317|           val = array[i];
#  318|           sud->init[i] = val;
#  319|->         sud->state[i] = val;
#  320|           if (val == 0)
#  321|               sud->locs[locs_index++] = i;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2076]
leptonica-1.87.0/src/sudoku.c:321:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(81, 4)’
leptonica-1.87.0/src/sudoku.c:313:28: acquire_memory: this call could return NULL
leptonica-1.87.0/src/sudoku.c:316:17: branch_true: following ‘true’ branch (when ‘i != 81’)...
leptonica-1.87.0/src/sudoku.c:317:20: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:320:12: branch_true: following ‘true’ branch (when ‘val == 0’)...
leptonica-1.87.0/src/sudoku.c:321:23: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:321:13: danger: ‘calloc(81, 4) + (long unsigned int)locs_index * 4’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  319|           sud->state[i] = val;
#  320|           if (val == 0)
#  321|->             sud->locs[locs_index++] = i;
#  322|       }
#  323|       sud->num = locs_index;

Error: CPPCHECK_WARNING (CWE-476): [#def2077]
leptonica-1.87.0/src/sudoku.c:323: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sud
#  321|               sud->locs[locs_index++] = i;
#  322|       }
#  323|->     sud->num = locs_index;
#  324|       sud->failure = FALSE;
#  325|       sud->finished = FALSE;

Error: CPPCHECK_WARNING (CWE-476): [#def2078]
leptonica-1.87.0/src/sudoku.c:324: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sud
#  322|       }
#  323|       sud->num = locs_index;
#  324|->     sud->failure = FALSE;
#  325|       sud->finished = FALSE;
#  326|       return sud;

Error: CPPCHECK_WARNING (CWE-476): [#def2079]
leptonica-1.87.0/src/sudoku.c:325: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sud
#  323|       sud->num = locs_index;
#  324|       sud->failure = FALSE;
#  325|->     sud->finished = FALSE;
#  326|       return sud;
#  327|   }

Error: CPPCHECK_WARNING (CWE-476): [#def2080]
leptonica-1.87.0/src/sudoku.c:670: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rarray
#  668|                for (i = 8; i >= 0; i--) {
#  669|                    sindex = 9 * i + j;
#  670|->                  rarray[dindex++] = array[sindex];
#  671|                }
#  672|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2081]
leptonica-1.87.0/src/sudoku.c:670:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rarray’
leptonica-1.87.0/src/sudoku.c:660:8: branch_false: following ‘false’ branch (when ‘array’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:662:9: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:662:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:665:25: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:665:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/sudoku.c:666:8: branch_true: following ‘true’ branch (when ‘quads == 1’)...
leptonica-1.87.0/src/sudoku.c:666:8: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:667:33: branch_true: following ‘true’ branch (when ‘j != 9’)...
leptonica-1.87.0/src/sudoku.c:667:33: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:668:26: branch_true: following ‘true’ branch (when ‘i != -1’)...
leptonica-1.87.0/src/sudoku.c:669:27: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:670:18: danger: ‘rarray + (long unsigned int)dindex * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
#  668|                for (i = 8; i >= 0; i--) {
#  669|                    sindex = 9 * i + j;
#  670|->                  rarray[dindex++] = array[sindex];
#  671|                }
#  672|           }

Error: CPPCHECK_WARNING (CWE-476): [#def2082]
leptonica-1.87.0/src/sudoku.c:677: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rarray
#  675|                for (j = 8; j >= 0; j--) {
#  676|                    sindex = 9 * i + j;
#  677|->                  rarray[dindex++] = array[sindex];
#  678|                }
#  679|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2083]
leptonica-1.87.0/src/sudoku.c:677:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rarray’
leptonica-1.87.0/src/sudoku.c:660:8: branch_false: following ‘false’ branch (when ‘array’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:662:9: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:662:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:665:25: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:665:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/sudoku.c:666:8: branch_false: following ‘false’ branch (when ‘quads != 1’)...
leptonica-1.87.0/src/sudoku.c:673:15: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:673:15: branch_true: following ‘true’ branch (when ‘quads == 2’)...
leptonica-1.87.0/src/sudoku.c:673:15: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:674:33: branch_true: following ‘true’ branch (when ‘i != -1’)...
leptonica-1.87.0/src/sudoku.c:674:33: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:675:26: branch_true: following ‘true’ branch (when ‘j != -1’)...
leptonica-1.87.0/src/sudoku.c:676:27: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:677:18: danger: ‘rarray + (long unsigned int)dindex * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
#  675|                for (j = 8; j >= 0; j--) {
#  676|                    sindex = 9 * i + j;
#  677|->                  rarray[dindex++] = array[sindex];
#  678|                }
#  679|           }

Error: CPPCHECK_WARNING (CWE-476): [#def2084]
leptonica-1.87.0/src/sudoku.c:684: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rarray
#  682|                for (i = 0; i < 9; i++) {
#  683|                    sindex = 9 * i + j;
#  684|->                  rarray[dindex++] = array[sindex];
#  685|                }
#  686|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2085]
leptonica-1.87.0/src/sudoku.c:684:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rarray’
leptonica-1.87.0/src/sudoku.c:660:8: branch_false: following ‘false’ branch (when ‘array’ is non-NULL)...
leptonica-1.87.0/src/sudoku.c:662:9: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:662:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/sudoku.c:665:25: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:665:25: acquire_memory: this call could return NULL
leptonica-1.87.0/src/sudoku.c:666:8: branch_false: following ‘false’ branch (when ‘quads != 1’)...
leptonica-1.87.0/src/sudoku.c:673:15: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:673:15: branch_false: following ‘false’ branch (when ‘quads != 2’)...
leptonica-1.87.0/src/sudoku.c:673:15: branch_false: ...to here
leptonica-1.87.0/src/sudoku.c:681:33: branch_true: following ‘true’ branch (when ‘j != -1’)...
leptonica-1.87.0/src/sudoku.c:681:33: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:682:26: branch_true: following ‘true’ branch (when ‘i != 9’)...
leptonica-1.87.0/src/sudoku.c:683:27: branch_true: ...to here
leptonica-1.87.0/src/sudoku.c:684:18: danger: ‘rarray + (long unsigned int)dindex * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
#  682|                for (i = 0; i < 9; i++) {
#  683|                    sindex = 9 * i + j;
#  684|->                  rarray[dindex++] = array[sindex];
#  685|                }
#  686|           }

Error: COMPILER_WARNING (CWE-457): [#def2086]
leptonica-1.87.0/src/textops.c:1036:41: warning[-Wmaybe-uninitialized]: ‘allwhite’ may be used uninitialized
# 1036 |             (splitflag == SPLIT_ON_BOTH && (allwhite || leadwhite))) {
#      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
leptonica-1.87.0/src/textops.c: scope_hint: In function ‘splitStringToParagraphs’
leptonica-1.87.0/src/textops.c:1016:21: note: ‘allwhite’ was declared here
# 1016 | l_int32  nlines, i, allwhite, leadwhite;
#      |                     ^~~~~~~~
# 1034|           if ((splitflag == SPLIT_ON_LEADING_WHITE && leadwhite) ||
# 1035|               (splitflag == SPLIT_ON_BLANK_LINE && allwhite) ||
# 1036|->             (splitflag == SPLIT_ON_BOTH && (allwhite || leadwhite))) {
# 1037|               parastring = sarrayToString(satemp, 1);  /* add nl to each line */
# 1038|               sarrayAddString(saout, parastring, L_INSERT);

Error: COMPILER_WARNING (CWE-457): [#def2087]
leptonica-1.87.0/src/textops.c:1036:54: warning[-Wmaybe-uninitialized]: ‘leadwhite’ may be used uninitialized
# 1036 |             (splitflag == SPLIT_ON_BOTH && (allwhite || leadwhite))) {
#      |                                            ~~~~~~~~~~^~~~~~~~~~~~~
leptonica-1.87.0/src/textops.c: scope_hint: In function ‘splitStringToParagraphs’
leptonica-1.87.0/src/textops.c:1016:31: note: ‘leadwhite’ was declared here
# 1016 | l_int32  nlines, i, allwhite, leadwhite;
#      |                               ^~~~~~~~~
# 1034|           if ((splitflag == SPLIT_ON_LEADING_WHITE && leadwhite) ||
# 1035|               (splitflag == SPLIT_ON_BLANK_LINE && allwhite) ||
# 1036|->             (splitflag == SPLIT_ON_BOTH && (allwhite || leadwhite))) {
# 1037|               parastring = sarrayToString(satemp, 1);  /* add nl to each line */
# 1038|               sarrayAddString(saout, parastring, L_INSERT);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2088]
leptonica-1.87.0/src/tiffio.c:635:17: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:532:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:532:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:544:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:559:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:570:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:577:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:579:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:586:5: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:592:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:592:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:603:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:626:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:628:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:632:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:633:30: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:633:30: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:634:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:635:17: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:635:17: throw: if ‘TIFFReadScanline’ throws an exception...
leptonica-1.87.0/src/tiffio.c:635:17: danger: ‘linebuf’ leaks here; was allocated at [(23)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/22)
#  633|           linebuf = (l_uint8 *)LEPT_CALLOC(4 * wpl, sizeof(l_uint8));
#  634|           for (i = 0; i < h; i++) {
#  635|->             if (TIFFReadScanline(tif, linebuf, i, 0) < 0) {
#  636|                   LEPT_FREE(linebuf);
#  637|                   pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2089]
leptonica-1.87.0/src/tiffio.c:645:13: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:532:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:532:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:544:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:559:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:570:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:577:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:579:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:586:5: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:592:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:592:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:603:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:626:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:628:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:632:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:633:30: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:633:30: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:634:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:644:13: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:644:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:645:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:645:13: throw: if ‘pixEndianByteSwap’ throws an exception...
leptonica-1.87.0/src/tiffio.c:645:13: danger: ‘linebuf’ leaks here; was allocated at [(23)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/22)
#  643|           }
#  644|           if (bps <= 8)
#  645|->             pixEndianByteSwap(pix);
#  646|           else   /* bps == 16 */
#  647|               pixEndianTwoByteSwap(pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2090]
leptonica-1.87.0/src/tiffio.c:647:13: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:532:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:532:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:544:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:559:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:570:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:577:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:579:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:586:5: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:592:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:592:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:603:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:626:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:628:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:632:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:633:30: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:633:30: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:634:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:644:13: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:644:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:647:13: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:647:13: throw: if ‘pixEndianTwoByteSwap’ throws an exception...
leptonica-1.87.0/src/tiffio.c:647:13: danger: ‘linebuf’ leaks here; was allocated at [(23)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/22)
#  645|               pixEndianByteSwap(pix);
#  646|           else   /* bps == 16 */
#  647|->             pixEndianTwoByteSwap(pix);
#  648|           LEPT_FREE(linebuf);
#  649|       } else if (spp == 2 && bps == 8) {  /* gray plus alpha */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2091]
leptonica-1.87.0/src/tiffio.c:653:19: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:532:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:532:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:544:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:559:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:570:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:577:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:579:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:586:5: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:592:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:592:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:603:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:626:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:628:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:632:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:649:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:649:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:652:30: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:653:19: throw: if ‘pixGetData’ throws an exception...
leptonica-1.87.0/src/tiffio.c:653:19: danger: ‘linebuf’ leaks here; was allocated at [(25)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/24)
#  651|           pixSetSpp(pix, 4);
#  652|           linebuf = (l_uint8 *)LEPT_CALLOC(4 * wpl, sizeof(l_uint8));
#  653|->         pixdata = pixGetData(pix);
#  654|           for (i = 0; i < h; i++) {
#  655|               if (TIFFReadScanline(tif, linebuf, i, 0) < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2092]
leptonica-1.87.0/src/tiffio.c:655:17: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:532:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:532:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:544:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:559:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:570:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:577:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:579:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:586:5: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:592:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:592:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:603:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:626:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:628:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:632:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:649:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:649:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:652:30: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:654:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:655:17: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:655:17: throw: if ‘TIFFReadScanline’ throws an exception...
leptonica-1.87.0/src/tiffio.c:655:17: danger: ‘linebuf’ leaks here; was allocated at [(25)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/24)
#  653|           pixdata = pixGetData(pix);
#  654|           for (i = 0; i < h; i++) {
#  655|->             if (TIFFReadScanline(tif, linebuf, i, 0) < 0) {
#  656|                   LEPT_FREE(linebuf);
#  657|                   pixDestroy(&pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2093]
leptonica-1.87.0/src/tiffio.c:680:14: warning[-Wanalyzer-malloc-leak]: leak of ‘tiffdata’
leptonica-1.87.0/src/tiffio.c:522:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:532:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:532:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:544:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:545:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:552:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:559:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:570:9: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:575:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:577:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:579:15: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:586:5: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:588:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:592:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:592:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:603:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:626:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:628:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:632:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:649:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:674:37: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:674:12: branch_false: following ‘false’ branch (when ‘tiffdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:680:14: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:680:14: throw: if ‘TIFFReadRGBAImageOriented’ throws an exception...
leptonica-1.87.0/src/tiffio.c:680:14: danger: ‘tiffdata’ leaks here; was allocated at [(23)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/22)
#  678|           }
#  679|               /* TIFFReadRGBAImageOriented() converts to 8 bps */
#  680|->         if (!TIFFReadRGBAImageOriented(tif, w, h, tiffdata,
#  681|                                          ORIENTATION_TOPLEFT, 0)) {
#  682|               LEPT_FREE(tiffdata);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2094]
leptonica-1.87.0/src/tiffio.c:1162:5: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:1469:1: enter_function: entry to ‘pixaWriteMultipageTiff’
leptonica-1.87.0/src/tiffio.c:1476:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1481:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1482:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:1484:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1485:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1486:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1486:13: call_function: calling ‘pixWriteTiff’ from ‘pixaWriteMultipageTiff’
# 1160|   
# 1161|           /* Use single strip for image */
# 1162|->     TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, h);
# 1163|   
# 1164|       if (d != 24 && d != 32) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2095]
leptonica-1.87.0/src/tiffio.c:1166:20: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:1469:1: enter_function: entry to ‘pixaWriteMultipageTiff’
leptonica-1.87.0/src/tiffio.c:1476:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1481:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1482:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:1484:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1485:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1486:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1486:13: call_function: calling ‘pixWriteTiff’ from ‘pixaWriteMultipageTiff’
# 1164|       if (d != 24 && d != 32) {
# 1165|           if (d == 16)
# 1166|->             pixt = pixEndianTwoByteSwapNew(pix);
# 1167|           else
# 1168|               pixt = pixEndianByteSwapNew(pix);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2096]
leptonica-1.87.0/src/tiffio.c:1168:20: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:1469:1: enter_function: entry to ‘pixaWriteMultipageTiff’
leptonica-1.87.0/src/tiffio.c:1476:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1481:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1482:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:1484:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1485:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1486:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1486:13: call_function: calling ‘pixWriteTiff’ from ‘pixaWriteMultipageTiff’
# 1166|               pixt = pixEndianTwoByteSwapNew(pix);
# 1167|           else
# 1168|->             pixt = pixEndianByteSwapNew(pix);
# 1169|           data = (l_uint8 *)pixGetData(pixt);
# 1170|           for (i = 0; i < h; i++, data += bpl) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2097]
leptonica-1.87.0/src/tiffio.c:1169:27: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:1469:1: enter_function: entry to ‘pixaWriteMultipageTiff’
leptonica-1.87.0/src/tiffio.c:1476:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1481:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1482:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:1484:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1485:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1486:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1486:13: call_function: calling ‘pixWriteTiff’ from ‘pixaWriteMultipageTiff’
# 1167|           else
# 1168|               pixt = pixEndianByteSwapNew(pix);
# 1169|->         data = (l_uint8 *)pixGetData(pixt);
# 1170|           for (i = 0; i < h; i++, data += bpl) {
# 1171|               memcpy(linebuf, data, tiffbpl);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2098]
leptonica-1.87.0/src/tiffio.c:1172:17: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:1469:1: enter_function: entry to ‘pixaWriteMultipageTiff’
leptonica-1.87.0/src/tiffio.c:1476:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1481:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1482:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:1484:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1485:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1486:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1486:13: call_function: calling ‘pixWriteTiff’ from ‘pixaWriteMultipageTiff’
# 1170|           for (i = 0; i < h; i++, data += bpl) {
# 1171|               memcpy(linebuf, data, tiffbpl);
# 1172|->             if (TIFFWriteScanline(tif, linebuf, i, 0) < 0)
# 1173|                   break;
# 1174|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2099]
leptonica-1.87.0/src/tiffio.c:1175:9: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:1469:1: enter_function: entry to ‘pixaWriteMultipageTiff’
leptonica-1.87.0/src/tiffio.c:1476:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1481:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1482:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:1484:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1485:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1486:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1486:13: call_function: calling ‘pixWriteTiff’ from ‘pixaWriteMultipageTiff’
# 1173|                   break;
# 1174|           }
# 1175|->         pixDestroy(&pixt);
# 1176|       } else if (d == 24) {  /* See note 4 above: special case of 24 bpp rgb */
# 1177|           for (i = 0; i < h; i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2100]
leptonica-1.87.0/src/tiffio.c:1178:20: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:1469:1: enter_function: entry to ‘pixaWriteMultipageTiff’
leptonica-1.87.0/src/tiffio.c:1476:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1481:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1482:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:1484:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1485:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1486:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1486:13: call_function: calling ‘pixWriteTiff’ from ‘pixaWriteMultipageTiff’
# 1176|       } else if (d == 24) {  /* See note 4 above: special case of 24 bpp rgb */
# 1177|           for (i = 0; i < h; i++) {
# 1178|->             line = pixGetData(pix) + i * wpl;
# 1179|               if (TIFFWriteScanline(tif, (l_uint8 *)line, i, 0) < 0)
# 1180|                   break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2101]
leptonica-1.87.0/src/tiffio.c:1179:17: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:1469:1: enter_function: entry to ‘pixaWriteMultipageTiff’
leptonica-1.87.0/src/tiffio.c:1476:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1481:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1482:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:1484:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1485:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1486:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1486:13: call_function: calling ‘pixWriteTiff’ from ‘pixaWriteMultipageTiff’
# 1177|           for (i = 0; i < h; i++) {
# 1178|               line = pixGetData(pix) + i * wpl;
# 1179|->             if (TIFFWriteScanline(tif, (l_uint8 *)line, i, 0) < 0)
# 1180|                   break;
# 1181|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2102]
leptonica-1.87.0/src/tiffio.c:1184:20: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:1469:1: enter_function: entry to ‘pixaWriteMultipageTiff’
leptonica-1.87.0/src/tiffio.c:1476:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1481:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1482:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:1484:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1485:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1486:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1486:13: call_function: calling ‘pixWriteTiff’ from ‘pixaWriteMultipageTiff’
# 1182|       } else {  /* 32 bpp rgb or rgba */
# 1183|           for (i = 0; i < h; i++) {
# 1184|->             line = pixGetData(pix) + i * wpl;
# 1185|               for (j = 0, k = 0, ppixel = line; j < w; j++) {
# 1186|                   linebuf[k++] = GET_DATA_BYTE(ppixel, COLOR_RED);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2103]
leptonica-1.87.0/src/tiffio.c:1193:17: warning[-Wanalyzer-malloc-leak]: leak of ‘linebuf’
leptonica-1.87.0/src/tiffio.c:1469:1: enter_function: entry to ‘pixaWriteMultipageTiff’
leptonica-1.87.0/src/tiffio.c:1476:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1478:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:1481:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:1482:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1483:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:1484:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1485:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:1486:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:1486:13: call_function: calling ‘pixWriteTiff’ from ‘pixaWriteMultipageTiff’
# 1191|                   ppixel++;
# 1192|               }
# 1193|->             if (TIFFWriteScanline(tif, linebuf, i, 0) < 0)
# 1194|                   break;
# 1195|           }

Error: CPPCHECK_WARNING (CWE-476): [#def2104]
leptonica-1.87.0/src/tiffio.c:2364: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mstream
# 2362|   
# 2363|       mstream = (L_MEMSTREAM *)LEPT_CALLOC(1, sizeof(L_MEMSTREAM));
# 2364|->     mstream->buffer = indata;   /* handle to input data array */
# 2365|       mstream->bufsize = insize;  /* amount of input data */
# 2366|       mstream->hw = insize;       /* high-water mark fixed at input data size */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2105]
leptonica-1.87.0/src/tiffio.c:2364:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mstream’
leptonica-1.87.0/src/tiffio.c:2363:30: acquire_memory: this call could return NULL
leptonica-1.87.0/src/tiffio.c:2364:5: danger: ‘mstream’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
# 2362|   
# 2363|       mstream = (L_MEMSTREAM *)LEPT_CALLOC(1, sizeof(L_MEMSTREAM));
# 2364|->     mstream->buffer = indata;   /* handle to input data array */
# 2365|       mstream->bufsize = insize;  /* amount of input data */
# 2366|       mstream->hw = insize;       /* high-water mark fixed at input data size */

Error: CPPCHECK_WARNING (CWE-476): [#def2106]
leptonica-1.87.0/src/tiffio.c:2365: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mstream
# 2363|       mstream = (L_MEMSTREAM *)LEPT_CALLOC(1, sizeof(L_MEMSTREAM));
# 2364|       mstream->buffer = indata;   /* handle to input data array */
# 2365|->     mstream->bufsize = insize;  /* amount of input data */
# 2366|       mstream->hw = insize;       /* high-water mark fixed at input data size */
# 2367|       mstream->offset = 0;        /* offset always starts at 0 */

Error: CPPCHECK_WARNING (CWE-476): [#def2107]
leptonica-1.87.0/src/tiffio.c:2366: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mstream
# 2364|       mstream->buffer = indata;   /* handle to input data array */
# 2365|       mstream->bufsize = insize;  /* amount of input data */
# 2366|->     mstream->hw = insize;       /* high-water mark fixed at input data size */
# 2367|       mstream->offset = 0;        /* offset always starts at 0 */
# 2368|       return mstream;

Error: CPPCHECK_WARNING (CWE-476): [#def2108]
leptonica-1.87.0/src/tiffio.c:2367: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mstream
# 2365|       mstream->bufsize = insize;  /* amount of input data */
# 2366|       mstream->hw = insize;       /* high-water mark fixed at input data size */
# 2367|->     mstream->offset = 0;        /* offset always starts at 0 */
# 2368|       return mstream;
# 2369|   }

Error: CPPCHECK_WARNING (CWE-476): [#def2109]
leptonica-1.87.0/src/tiffio.c:2379: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mstream
# 2377|   
# 2378|       mstream = (L_MEMSTREAM *)LEPT_CALLOC(1, sizeof(L_MEMSTREAM));
# 2379|->     mstream->buffer = (l_uint8 *)LEPT_CALLOC(8 * 1024, 1);
# 2380|       mstream->bufsize = 8 * 1024;
# 2381|       mstream->poutdata = poutdata;  /* used only at end of write */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2110]
leptonica-1.87.0/src/tiffio.c:2379:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘mstream’
leptonica-1.87.0/src/tiffio.c:2378:30: acquire_memory: this call could return NULL
leptonica-1.87.0/src/tiffio.c:2379:5: danger: ‘mstream’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
# 2377|   
# 2378|       mstream = (L_MEMSTREAM *)LEPT_CALLOC(1, sizeof(L_MEMSTREAM));
# 2379|->     mstream->buffer = (l_uint8 *)LEPT_CALLOC(8 * 1024, 1);
# 2380|       mstream->bufsize = 8 * 1024;
# 2381|       mstream->poutdata = poutdata;  /* used only at end of write */

Error: CPPCHECK_WARNING (CWE-476): [#def2111]
leptonica-1.87.0/src/tiffio.c:2380: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mstream
# 2378|       mstream = (L_MEMSTREAM *)LEPT_CALLOC(1, sizeof(L_MEMSTREAM));
# 2379|       mstream->buffer = (l_uint8 *)LEPT_CALLOC(8 * 1024, 1);
# 2380|->     mstream->bufsize = 8 * 1024;
# 2381|       mstream->poutdata = poutdata;  /* used only at end of write */
# 2382|       mstream->poutsize = poutsize;  /* ditto  */

Error: CPPCHECK_WARNING (CWE-476): [#def2112]
leptonica-1.87.0/src/tiffio.c:2381: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mstream
# 2379|       mstream->buffer = (l_uint8 *)LEPT_CALLOC(8 * 1024, 1);
# 2380|       mstream->bufsize = 8 * 1024;
# 2381|->     mstream->poutdata = poutdata;  /* used only at end of write */
# 2382|       mstream->poutsize = poutsize;  /* ditto  */
# 2383|       mstream->hw = mstream->offset = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def2113]
leptonica-1.87.0/src/tiffio.c:2382: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mstream
# 2380|       mstream->bufsize = 8 * 1024;
# 2381|       mstream->poutdata = poutdata;  /* used only at end of write */
# 2382|->     mstream->poutsize = poutsize;  /* ditto  */
# 2383|       mstream->hw = mstream->offset = 0;
# 2384|       return mstream;

Error: CPPCHECK_WARNING (CWE-476): [#def2114]
leptonica-1.87.0/src/tiffio.c:2383: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mstream
# 2381|       mstream->poutdata = poutdata;  /* used only at end of write */
# 2382|       mstream->poutsize = poutsize;  /* ditto  */
# 2383|->     mstream->hw = mstream->offset = 0;
# 2384|       return mstream;
# 2385|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2115]
leptonica-1.87.0/src/tiffio.c:2568:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/tiffio.c:2542:1: enter_function: entry to ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2550:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: following ‘false’ branch (when ‘operation’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: following ‘false’ branch (when ‘pdatasize’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2558:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2558:9: branch_false: following ‘false’ branch (when the strings are equal)...
leptonica-1.87.0/src/tiffio.c:2561:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2561:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
leptonica-1.87.0/src/tiffio.c:2564:19: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2564:19: call_function: calling ‘memstreamCreateForWrite’ from ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2564:19: return_function: returning to ‘fopenTiffMemstream’ from ‘memstreamCreateForWrite’
leptonica-1.87.0/src/tiffio.c:2568:5: throw: if ‘TIFFSetWarningHandler’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2568:5: danger: ‘<unknown>’ leaks here; was allocated at [(16)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/15)
# 2566|           return (TIFF *)ERROR_PTR("mstream not made", __func__, NULL);
# 2567|   
# 2568|->     TIFFSetWarningHandler(NULL);  /* disable warnings */
# 2569|       TIFFSetErrorHandler(NULL);  /* disable error messages */
# 2570|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2116]
leptonica-1.87.0/src/tiffio.c:2568:5: warning[-Wanalyzer-malloc-leak]: leak of ‘mstream’
leptonica-1.87.0/src/tiffio.c:2542:1: enter_function: entry to ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2550:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: following ‘false’ branch (when ‘operation’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: following ‘false’ branch (when ‘pdatasize’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2558:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2561:8: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/src/tiffio.c:2562:19: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2562:19: call_function: calling ‘memstreamCreateForRead’ from ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2562:19: return_function: returning to ‘fopenTiffMemstream’ from ‘memstreamCreateForRead’
leptonica-1.87.0/src/tiffio.c:2568:5: throw: if ‘TIFFSetWarningHandler’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2568:5: danger: ‘mstream’ leaks here; was allocated at [(14)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/13)
# 2566|           return (TIFF *)ERROR_PTR("mstream not made", __func__, NULL);
# 2567|   
# 2568|->     TIFFSetWarningHandler(NULL);  /* disable warnings */
# 2569|       TIFFSetErrorHandler(NULL);  /* disable error messages */
# 2570|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2117]
leptonica-1.87.0/src/tiffio.c:2569:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/tiffio.c:2542:1: enter_function: entry to ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2550:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: following ‘false’ branch (when ‘operation’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: following ‘false’ branch (when ‘pdatasize’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2558:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2558:9: branch_false: following ‘false’ branch (when the strings are equal)...
leptonica-1.87.0/src/tiffio.c:2561:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2561:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
leptonica-1.87.0/src/tiffio.c:2564:19: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2564:19: call_function: calling ‘memstreamCreateForWrite’ from ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2564:19: return_function: returning to ‘fopenTiffMemstream’ from ‘memstreamCreateForWrite’
leptonica-1.87.0/src/tiffio.c:2569:5: throw: if ‘TIFFSetErrorHandler’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2569:5: danger: ‘<unknown>’ leaks here; was allocated at [(16)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/15)
# 2567|   
# 2568|       TIFFSetWarningHandler(NULL);  /* disable warnings */
# 2569|->     TIFFSetErrorHandler(NULL);  /* disable error messages */
# 2570|   
# 2571|       tif = TIFFClientOpen(filename, operation, (thandle_t)mstream,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2118]
leptonica-1.87.0/src/tiffio.c:2569:5: warning[-Wanalyzer-malloc-leak]: leak of ‘mstream’
leptonica-1.87.0/src/tiffio.c:2542:1: enter_function: entry to ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2550:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: following ‘false’ branch (when ‘operation’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: following ‘false’ branch (when ‘pdatasize’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2558:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2561:8: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/src/tiffio.c:2562:19: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2562:19: call_function: calling ‘memstreamCreateForRead’ from ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2562:19: return_function: returning to ‘fopenTiffMemstream’ from ‘memstreamCreateForRead’
leptonica-1.87.0/src/tiffio.c:2569:5: throw: if ‘TIFFSetErrorHandler’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2569:5: danger: ‘mstream’ leaks here; was allocated at [(14)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/13)
# 2567|   
# 2568|       TIFFSetWarningHandler(NULL);  /* disable warnings */
# 2569|->     TIFFSetErrorHandler(NULL);  /* disable error messages */
# 2570|   
# 2571|       tif = TIFFClientOpen(filename, operation, (thandle_t)mstream,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2119]
leptonica-1.87.0/src/tiffio.c:2571:11: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
leptonica-1.87.0/src/tiffio.c:2542:1: enter_function: entry to ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2550:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: following ‘false’ branch (when ‘operation’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: following ‘false’ branch (when ‘pdatasize’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2558:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2558:9: branch_false: following ‘false’ branch (when the strings are equal)...
leptonica-1.87.0/src/tiffio.c:2561:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2561:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
leptonica-1.87.0/src/tiffio.c:2564:19: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2564:19: call_function: calling ‘memstreamCreateForWrite’ from ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2564:19: return_function: returning to ‘fopenTiffMemstream’ from ‘memstreamCreateForWrite’
leptonica-1.87.0/src/tiffio.c:2571:11: throw: if ‘TIFFClientOpen’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2571:11: danger: ‘<unknown>’ leaks here; was allocated at [(16)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/15)
# 2569|       TIFFSetErrorHandler(NULL);  /* disable error messages */
# 2570|   
# 2571|->     tif = TIFFClientOpen(filename, operation, (thandle_t)mstream,
# 2572|                            tiffReadCallback, tiffWriteCallback,
# 2573|                            tiffSeekCallback, tiffCloseCallback,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2120]
leptonica-1.87.0/src/tiffio.c:2571:11: warning[-Wanalyzer-malloc-leak]: leak of ‘mstream’
leptonica-1.87.0/src/tiffio.c:2542:1: enter_function: entry to ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2550:8: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2552:8: branch_false: following ‘false’ branch (when ‘operation’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2554:8: branch_false: following ‘false’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2556:8: branch_false: following ‘false’ branch (when ‘pdatasize’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2558:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2561:8: branch_true: following ‘true’ branch (when the strings are equal)...
leptonica-1.87.0/src/tiffio.c:2562:19: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2562:19: call_function: calling ‘memstreamCreateForRead’ from ‘fopenTiffMemstream’
leptonica-1.87.0/src/tiffio.c:2562:19: return_function: returning to ‘fopenTiffMemstream’ from ‘memstreamCreateForRead’
leptonica-1.87.0/src/tiffio.c:2571:11: throw: if ‘TIFFClientOpen’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2571:11: danger: ‘mstream’ leaks here; was allocated at [(14)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/13)
# 2569|       TIFFSetErrorHandler(NULL);  /* disable error messages */
# 2570|   
# 2571|->     tif = TIFFClientOpen(filename, operation, (thandle_t)mstream,
# 2572|                            tiffReadCallback, tiffWriteCallback,
# 2573|                            tiffSeekCallback, tiffCloseCallback,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2121]
leptonica-1.87.0/src/tiffio.c:2781:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
leptonica-1.87.0/src/tiffio.c:2767:8: branch_true: following ‘true’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2767:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2770:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2777:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2777:15: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:2777:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:2781:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2781:9: throw: if ‘pixaGetCount’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2781:9: danger: ‘tmpfile()’ leaks here; was allocated at [(5)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/4)
# 2779|   #endif  /* _WIN32 */
# 2780|   
# 2781|->     n = pixaGetCount(pixa);
# 2782|       for (i = 0; i < n; i++) {
# 2783|           modestr = (i == 0) ? "w" : "a";

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2122]
leptonica-1.87.0/src/tiffio.c:2784:16: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
leptonica-1.87.0/src/tiffio.c:2767:8: branch_true: following ‘true’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2767:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2770:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2777:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2777:15: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:2777:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:2781:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2782:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:2783:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2783:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:2784:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2784:16: throw: if ‘pixaGetPix’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2784:16: danger: ‘tmpfile()’ leaks here; was allocated at [(5)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/4)
# 2782|       for (i = 0; i < n; i++) {
# 2783|           modestr = (i == 0) ? "w" : "a";
# 2784|->         pix1 = pixaGetPix(pixa, i, L_CLONE);
# 2785|           if (pixGetDepth(pix1) == 1)
# 2786|               pixWriteStreamTiffWA(fp, pix1, IFF_TIFF_G4, modestr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2123]
leptonica-1.87.0/src/tiffio.c:2785:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
leptonica-1.87.0/src/tiffio.c:2767:8: branch_true: following ‘true’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2767:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2770:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2777:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2777:15: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:2777:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:2781:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2782:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:2783:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2783:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:2784:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2785:13: throw: if ‘pixGetDepth’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2785:13: danger: ‘tmpfile()’ leaks here; was allocated at [(5)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/4)
# 2783|           modestr = (i == 0) ? "w" : "a";
# 2784|           pix1 = pixaGetPix(pixa, i, L_CLONE);
# 2785|->         if (pixGetDepth(pix1) == 1)
# 2786|               pixWriteStreamTiffWA(fp, pix1, IFF_TIFF_G4, modestr);
# 2787|           else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2124]
leptonica-1.87.0/src/tiffio.c:2786:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
leptonica-1.87.0/src/tiffio.c:2758:1: enter_function: entry to ‘pixaWriteMemMultipageTiff’
leptonica-1.87.0/src/tiffio.c:2767:8: branch_true: following ‘true’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2767:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2770:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2777:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2777:15: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:2777:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:2781:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2782:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:2783:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2783:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:2784:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2785:12: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:2786:13: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2786:13: call_function: calling ‘pixWriteStreamTiffWA’ from ‘pixaWriteMemMultipageTiff’
# 2784|           pix1 = pixaGetPix(pixa, i, L_CLONE);
# 2785|           if (pixGetDepth(pix1) == 1)
# 2786|->             pixWriteStreamTiffWA(fp, pix1, IFF_TIFF_G4, modestr);
# 2787|           else
# 2788|               pixWriteStreamTiffWA(fp, pix1, IFF_TIFF_ZIP, modestr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2125]
leptonica-1.87.0/src/tiffio.c:2788:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
leptonica-1.87.0/src/tiffio.c:2758:1: enter_function: entry to ‘pixaWriteMemMultipageTiff’
leptonica-1.87.0/src/tiffio.c:2767:8: branch_true: following ‘true’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2767:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2770:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2777:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2777:15: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:2777:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:2781:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2782:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/tiffio.c:2783:9: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2783:9: branch_true: following ‘true’ branch (when ‘i == 0’)...
leptonica-1.87.0/src/tiffio.c:2784:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2785:12: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:2788:13: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2788:13: call_function: calling ‘pixWriteStreamTiffWA’ from ‘pixaWriteMemMultipageTiff’
# 2786|               pixWriteStreamTiffWA(fp, pix1, IFF_TIFF_G4, modestr);
# 2787|           else
# 2788|->             pixWriteStreamTiffWA(fp, pix1, IFF_TIFF_ZIP, modestr);
# 2789|           pixDestroy(&pix1);
# 2790|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2126]
leptonica-1.87.0/src/tiffio.c:2792:5: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
leptonica-1.87.0/src/tiffio.c:2767:8: branch_true: following ‘true’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2767:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2770:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2777:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2777:15: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:2777:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:2781:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2782:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:2792:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2792:5: throw: if ‘rewind’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2792:5: danger: ‘tmpfile()’ leaks here; was allocated at [(5)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/4)
# 2790|       }
# 2791|   
# 2792|->     rewind(fp);
# 2793|       *pdata = l_binaryReadStream(fp, psize);
# 2794|       fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2127]
leptonica-1.87.0/src/tiffio.c:2793:14: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
leptonica-1.87.0/src/tiffio.c:2767:8: branch_true: following ‘true’ branch (when ‘pdata’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2767:16: branch_true: ...to here
leptonica-1.87.0/src/tiffio.c:2770:8: branch_false: following ‘false’ branch (when ‘pixa’ is non-NULL)...
leptonica-1.87.0/src/tiffio.c:2777:15: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2777:15: acquire_memory: allocated here
leptonica-1.87.0/src/tiffio.c:2777:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:2781:9: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2782:17: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/tiffio.c:2792:5: branch_false: ...to here
leptonica-1.87.0/src/tiffio.c:2793:14: throw: if ‘l_binaryReadStream’ throws an exception...
leptonica-1.87.0/src/tiffio.c:2793:14: danger: ‘tmpfile()’ leaks here; was allocated at [(5)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/4)
# 2791|   
# 2792|       rewind(fp);
# 2793|->     *pdata = l_binaryReadStream(fp, psize);
# 2794|       fclose(fp);
# 2795|       return 0;

Error: CPPCHECK_WARNING (CWE-476): [#def2128]
leptonica-1.87.0/src/utils1.c:577: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dataout
#  575|       dataout = (l_uint8 *)LEPT_CALLOC(outbytes, 1);
#  576|       for (i = 0; i < locb; i++)
#  577|->         dataout[i] = datain[i];
#  578|       for (i = 0; i < rembytes; i++)
#  579|           dataout[locb + i] = datain[locb + sizeb + i];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2129]
leptonica-1.87.0/src/utils1.c:577:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dataout’
leptonica-1.87.0/src/utils1.c:556:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils1.c:558:8: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:558:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils1.c:560:8: branch_false: following ‘false’ branch (when ‘size > 0.0f’)...
leptonica-1.87.0/src/utils1.c:562:9: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:575:26: acquire_memory: this call could return NULL
leptonica-1.87.0/src/utils1.c:576:17: branch_true: following ‘true’ branch (when ‘i < locb’)...
leptonica-1.87.0/src/utils1.c:577:28: branch_true: ...to here
leptonica-1.87.0/src/utils1.c:577:9: danger: ‘dataout + (sizetype)i’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  575|       dataout = (l_uint8 *)LEPT_CALLOC(outbytes, 1);
#  576|       for (i = 0; i < locb; i++)
#  577|->         dataout[i] = datain[i];
#  578|       for (i = 0; i < rembytes; i++)
#  579|           dataout[locb + i] = datain[locb + sizeb + i];

Error: CPPCHECK_WARNING (CWE-476): [#def2130]
leptonica-1.87.0/src/utils1.c:579: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dataout
#  577|           dataout[i] = datain[i];
#  578|       for (i = 0; i < rembytes; i++)
#  579|->         dataout[locb + i] = datain[locb + sizeb + i];
#  580|       l_binaryWrite(fileout, "w", dataout, outbytes);
#  581|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2131]
leptonica-1.87.0/src/utils1.c:580:5: warning[-Wanalyzer-malloc-leak]: leak of ‘dataout’
leptonica-1.87.0/src/utils1.c:556:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils1.c:558:8: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:558:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils1.c:560:8: branch_false: following ‘false’ branch (when ‘size > 0.0f’)...
leptonica-1.87.0/src/utils1.c:562:9: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:575:26: acquire_memory: allocated here
leptonica-1.87.0/src/utils1.c:576:17: branch_false: following ‘false’ branch (when ‘i >= locb’)...
leptonica-1.87.0/src/utils1.c:576:17: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:578:17: branch_false: following ‘false’ branch (when ‘i >= rembytes’)...
leptonica-1.87.0/src/utils1.c:580:5: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:580:5: throw: if ‘l_binaryWrite’ throws an exception...
leptonica-1.87.0/src/utils1.c:580:5: danger: ‘dataout’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  578|       for (i = 0; i < rembytes; i++)
#  579|           dataout[locb + i] = datain[locb + sizeb + i];
#  580|->     l_binaryWrite(fileout, "w", dataout, outbytes);
#  581|   
#  582|       LEPT_FREE(datain);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2132]
leptonica-1.87.0/src/utils1.c:701:5: warning[-Wanalyzer-malloc-leak]: leak of ‘dataout’
leptonica-1.87.0/src/utils1.c:679:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils1.c:682:14: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:688:31: acquire_memory: allocated here
leptonica-1.87.0/src/utils1.c:688:8: branch_false: following ‘false’ branch (when ‘dataout’ is non-NULL)...
leptonica-1.87.0/src/utils1.c:688:8: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:693:17: branch_false: following ‘false’ branch (when ‘i >= start’)...
leptonica-1.87.0/src/utils1.c:693:17: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:695:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils1.c:698:11: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:699:21: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils1.c:701:5: branch_false: ...to here
leptonica-1.87.0/src/utils1.c:701:5: throw: if ‘l_binaryWrite’ throws an exception...
leptonica-1.87.0/src/utils1.c:701:5: danger: ‘dataout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  699|       for (i = start; i < outbytes; i++, index++)
#  700|           dataout[i] = datain[index];
#  701|->     l_binaryWrite(fileout, "w", dataout, outbytes);
#  702|   
#  703|       LEPT_FREE(datain);

Error: CPPCHECK_WARNING (CWE-476): [#def2133]
leptonica-1.87.0/src/utils1.c:1096: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: version
# 1094|   #else
# 1095|   
# 1096|->     snprintf(version, bufsize, "leptonica-%d.%d.%d", LIBLEPT_MAJOR_VERSION,
# 1097|                LIBLEPT_MINOR_VERSION, LIBLEPT_PATCH_VERSION);
# 1098|   

Error: GCC_ANALYZER_WARNING (CWE-121): [#def2134]
leptonica-1.87.0/src/utils1.c:1452:5: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
# 1450|   #endif
# 1451|       strftime(buf, sizeof(buf), "%Y%m%d%H%M%S", tptr);
# 1452|->     sprintf(buf + 14, "%c%02d'%02d'", sep, relh, relm);
# 1453|       return stringNew(buf);
# 1454|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2135]
leptonica-1.87.0/src/utils2.c:238:25: warning[-Wanalyzer-malloc-leak]: leak of ‘stringNew(pathname)’
leptonica-1.87.0/src/utils2.c:2746:1: enter_function: entry to ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:2754:8: branch_true: following ‘true’ branch (when ‘pdir’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:2754:15: branch_true: ...to here
leptonica-1.87.0/src/utils2.c:2755:8: branch_false: following ‘false’ branch (when ‘ptail’ is NULL)...
leptonica-1.87.0/src/utils2.c:2756:8: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2756:8: branch_false: following ‘false’ branch (when ‘pathname’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:2759:17: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2759:17: call_function: calling ‘stringNew’ from ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:2759:17: return_function: returning to ‘splitPathAtDirectory’ from ‘stringNew’
leptonica-1.87.0/src/utils2.c:2760:5: call_function: calling ‘convertSepCharsInPath’ from ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:2760:5: return_function: returning to ‘splitPathAtDirectory’ from ‘convertSepCharsInPath’
leptonica-1.87.0/src/utils2.c:2762:8: branch_false: following ‘false’ branch (when ‘lastslash’ is NULL)...
leptonica-1.87.0/src/utils2.c:2772:12: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2772:12: branch_true: following ‘true’ branch (when ‘pdir’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:2773:21: branch_true: ...to here
leptonica-1.87.0/src/utils2.c:2773:21: call_function: calling ‘stringNew’ from ‘splitPathAtDirectory’
#  236|   
#  237|       len = strlen(src);
#  238|->     if ((dest = (char *)LEPT_CALLOC(len + 1, sizeof(char))) == NULL)
#  239|           return (char *)ERROR_PTR("dest not made", __func__, NULL);
#  240|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2136]
leptonica-1.87.0/src/utils2.c:239:24: warning[-Wanalyzer-malloc-leak]: leak of ‘dir’
leptonica-1.87.0/src/utils2.c:3356:1: enter_function: entry to ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3363:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:3366:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:3366:5: call_function: calling ‘splitPathAtDirectory’ from ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3366:5: return_function: returning to ‘extractNumberFromFilename’ from ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:3367:5: call_function: calling ‘splitPathAtExtension’ from ‘extractNumberFromFilename’
#  237|       len = strlen(src);
#  238|       if ((dest = (char *)LEPT_CALLOC(len + 1, sizeof(char))) == NULL)
#  239|->         return (char *)ERROR_PTR("dest not made", __func__, NULL);
#  240|   
#  241|       stringCopy(dest, src, len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2137]
leptonica-1.87.0/src/utils2.c:239:24: warning[-Wanalyzer-malloc-leak]: leak of ‘tail’
leptonica-1.87.0/src/utils2.c:3356:1: enter_function: entry to ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3363:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:3366:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:3366:5: call_function: calling ‘splitPathAtDirectory’ from ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3366:5: return_function: returning to ‘extractNumberFromFilename’ from ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:3367:5: call_function: calling ‘splitPathAtExtension’ from ‘extractNumberFromFilename’
#  237|       len = strlen(src);
#  238|       if ((dest = (char *)LEPT_CALLOC(len + 1, sizeof(char))) == NULL)
#  239|->         return (char *)ERROR_PTR("dest not made", __func__, NULL);
#  240|   
#  241|       stringCopy(dest, src, len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2138]
leptonica-1.87.0/src/utils2.c:394:5: warning[-Wanalyzer-malloc-leak]: leak of ‘dest’
leptonica-1.87.0/src/utils2.c:3356:1: enter_function: entry to ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3363:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:3366:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:3366:5: call_function: calling ‘splitPathAtDirectory’ from ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3366:5: return_function: returning to ‘extractNumberFromFilename’ from ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:3367:5: call_function: calling ‘splitPathAtExtension’ from ‘extractNumberFromFilename’
#  392|   
#  393|           /* Didn't find a NUL byte */
#  394|->     L_ERROR("NUL byte not found in %zu bytes\n", __func__, size);
#  395|       return size;
#  396|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2139]
leptonica-1.87.0/src/utils2.c:394:5: warning[-Wanalyzer-malloc-leak]: leak of ‘newdir’
leptonica-1.87.0/src/utils2.c:2968:1: enter_function: entry to ‘appendSubdirs’
leptonica-1.87.0/src/utils2.c:2974:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils2.c:2978:12: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2981:27: acquire_memory: allocated here
leptonica-1.87.0/src/utils2.c:2981:8: branch_false: following ‘false’ branch (when ‘newdir’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:2983:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2983:5: call_function: calling ‘stringCat’ from ‘appendSubdirs’
#  392|   
#  393|           /* Didn't find a NUL byte */
#  394|->     L_ERROR("NUL byte not found in %zu bytes\n", __func__, size);
#  395|       return size;
#  396|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2140]
leptonica-1.87.0/src/utils2.c:431:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dest’
leptonica-1.87.0/src/utils2.c:3356:1: enter_function: entry to ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3363:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:3366:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:3366:5: call_function: calling ‘splitPathAtDirectory’ from ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3366:5: return_function: returning to ‘extractNumberFromFilename’ from ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:3367:5: call_function: calling ‘splitPathAtExtension’ from ‘extractNumberFromFilename’
#  429|           return ERROR_INT("dest not defined", __func__, -1);
#  430|       if (size < 1)
#  431|->         return ERROR_INT("size < 1; too small", __func__, -1);
#  432|       if (!src)
#  433|           return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2141]
leptonica-1.87.0/src/utils2.c:431:16: warning[-Wanalyzer-malloc-leak]: leak of ‘newdir’
leptonica-1.87.0/src/utils2.c:2968:1: enter_function: entry to ‘appendSubdirs’
leptonica-1.87.0/src/utils2.c:2974:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils2.c:2978:12: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2981:27: acquire_memory: allocated here
leptonica-1.87.0/src/utils2.c:2981:8: branch_false: following ‘false’ branch (when ‘newdir’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:2983:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2983:5: call_function: calling ‘stringCat’ from ‘appendSubdirs’
#  429|           return ERROR_INT("dest not defined", __func__, -1);
#  430|       if (size < 1)
#  431|->         return ERROR_INT("size < 1; too small", __func__, -1);
#  432|       if (!src)
#  433|           return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2142]
leptonica-1.87.0/src/utils2.c:437:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dest’
leptonica-1.87.0/src/utils2.c:3356:1: enter_function: entry to ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3363:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:3366:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:3366:5: call_function: calling ‘splitPathAtDirectory’ from ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3366:5: return_function: returning to ‘extractNumberFromFilename’ from ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:3367:5: call_function: calling ‘splitPathAtExtension’ from ‘extractNumberFromFilename’
#  435|       lendest = stringLength(dest, size);
#  436|       if (lendest == size)
#  437|->         return ERROR_INT("no terminating nul byte", __func__, -1);
#  438|       lensrc = stringLength(src, size);
#  439|       if (lensrc == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2143]
leptonica-1.87.0/src/utils2.c:437:16: warning[-Wanalyzer-malloc-leak]: leak of ‘newdir’
leptonica-1.87.0/src/utils2.c:2968:1: enter_function: entry to ‘appendSubdirs’
leptonica-1.87.0/src/utils2.c:2974:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils2.c:2978:12: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2981:27: acquire_memory: allocated here
leptonica-1.87.0/src/utils2.c:2981:8: branch_false: following ‘false’ branch (when ‘newdir’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:2983:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2983:5: call_function: calling ‘stringCat’ from ‘appendSubdirs’
#  435|       lendest = stringLength(dest, size);
#  436|       if (lendest == size)
#  437|->         return ERROR_INT("no terminating nul byte", __func__, -1);
#  438|       lensrc = stringLength(src, size);
#  439|       if (lensrc == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2144]
leptonica-1.87.0/src/utils2.c:443:16: warning[-Wanalyzer-malloc-leak]: leak of ‘newdir’
leptonica-1.87.0/src/utils2.c:2968:1: enter_function: entry to ‘appendSubdirs’
leptonica-1.87.0/src/utils2.c:2974:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils2.c:2978:12: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2981:27: acquire_memory: allocated here
leptonica-1.87.0/src/utils2.c:2981:8: branch_false: following ‘false’ branch (when ‘newdir’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:2983:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2983:5: call_function: calling ‘stringCat’ from ‘appendSubdirs’
#  441|       n = (lendest + lensrc > size - 1) ? 0 : lensrc;
#  442|       if (n == 0)
#  443|->         return ERROR_INT("dest too small for append", __func__, -1);
#  444|   
#  445|       for (i = 0; i < n; i++)

Error: GCC_ANALYZER_WARNING (CWE-122): [#def2145]
leptonica-1.87.0/src/utils2.c:446:9: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
leptonica-1.87.0/src/utils2.c:2968:1: enter_function: entry to ‘appendSubdirs’
leptonica-1.87.0/src/utils2.c:2974:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils2.c:2978:12: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2981:8: branch_false: following ‘false’ branch (when ‘newdir’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:2983:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2983:5: call_function: calling ‘stringCat’ from ‘appendSubdirs’
#  444|   
#  445|       for (i = 0; i < n; i++)
#  446|->         dest[lendest + i] = src[i];
#  447|       dest[lendest + n] = '\0';
#  448|       return n;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2146]
leptonica-1.87.0/src/utils2.c:2181:5: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
leptonica-1.87.0/src/utils2.c:2152:1: enter_function: entry to ‘lept_mkdir’
leptonica-1.87.0/src/utils2.c:2162:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils2.c:2168:8: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2168:8: branch_false: following ‘false’ branch (when ‘subdir’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:2170:9: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2170:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/utils2.c:2176:11: call_function: calling ‘genPathname’ from ‘lept_mkdir’
leptonica-1.87.0/src/utils2.c:2176:11: return_function: returning to ‘lept_mkdir’ from ‘genPathname’
leptonica-1.87.0/src/utils2.c:2181:5: danger: argument 1 (‘genPathname("/tmp", 0)’) NULL where non-null expected
# 2179|          /* Make sure the tmp directory exists */
# 2180|   #ifndef _WIN32
# 2181|->     mkdir(dir, 0777);
# 2182|   #else
# 2183|       attributes = GetFileAttributesA(dir);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2147]
leptonica-1.87.0/src/utils2.c:2761:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
leptonica-1.87.0/src/utils2.c:2746:1: enter_function: entry to ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:2754:8: branch_false: following ‘false’ branch (when ‘pdir’ is NULL)...
leptonica-1.87.0/src/utils2.c:2755:8: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2755:8: branch_false: following ‘false’ branch (when ‘ptail’ is NULL)...
leptonica-1.87.0/src/utils2.c:2756:8: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2756:8: branch_false: following ‘false’ branch (when ‘pathname’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:2759:17: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:2759:17: call_function: calling ‘stringNew’ from ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:2759:17: return_function: returning to ‘splitPathAtDirectory’ from ‘stringNew’
leptonica-1.87.0/src/utils2.c:2760:5: call_function: calling ‘convertSepCharsInPath’ from ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:2760:5: return_function: returning to ‘splitPathAtDirectory’ from ‘convertSepCharsInPath’
leptonica-1.87.0/src/utils2.c:2761:17: danger: argument 1 (‘stringNew(pathname)’) NULL where non-null expected
# 2759|       cpathname = stringNew(pathname);
# 2760|       convertSepCharsInPath(cpathname, UNIX_PATH_SEPCHAR);
# 2761|->     lastslash = strrchr(cpathname, '/');
# 2762|       if (lastslash) {
# 2763|           if (ptail)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2148]
leptonica-1.87.0/src/utils2.c:2761:17: warning[-Wanalyzer-null-argument]: use of NULL ‘tail’ where non-null expected
leptonica-1.87.0/src/utils2.c:3356:1: enter_function: entry to ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3363:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:3366:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:3366:5: call_function: calling ‘splitPathAtDirectory’ from ‘extractNumberFromFilename’
# 2759|       cpathname = stringNew(pathname);
# 2760|       convertSepCharsInPath(cpathname, UNIX_PATH_SEPCHAR);
# 2761|->     lastslash = strrchr(cpathname, '/');
# 2762|       if (lastslash) {
# 2763|           if (ptail)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2149]
leptonica-1.87.0/src/utils2.c:3370:11: warning[-Wanalyzer-null-argument]: use of NULL ‘tail’ where non-null expected
leptonica-1.87.0/src/utils2.c:3356:1: enter_function: entry to ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3363:8: branch_false: following ‘false’ branch (when ‘fname’ is non-NULL)...
leptonica-1.87.0/src/utils2.c:3366:5: branch_false: ...to here
leptonica-1.87.0/src/utils2.c:3366:5: call_function: calling ‘splitPathAtDirectory’ from ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3366:5: return_function: returning to ‘extractNumberFromFilename’ from ‘splitPathAtDirectory’
leptonica-1.87.0/src/utils2.c:3367:5: release_memory: ‘tail’ is NULL
leptonica-1.87.0/src/utils2.c:3367:5: call_function: calling ‘splitPathAtExtension’ from ‘extractNumberFromFilename’
leptonica-1.87.0/src/utils2.c:3367:5: return_function: returning to ‘extractNumberFromFilename’ from ‘splitPathAtExtension’
leptonica-1.87.0/src/utils2.c:3368:5: release_memory: ‘tail’ is NULL
leptonica-1.87.0/src/utils2.c:3370:11: release_memory: ‘tail’ is NULL
leptonica-1.87.0/src/utils2.c:3370:11: danger: argument 1 (‘basename’) NULL where non-null expected
# 3368|       LEPT_FREE(tail);
# 3369|   
# 3370|->     len = strlen(basename);
# 3371|       if (numpre + numpost > len - 1) {
# 3372|           LEPT_FREE(basename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2150]
leptonica-1.87.0/src/warper.c:242:31: warning[-Wanalyzer-malloc-leak]: leak of ‘generateRandomNumberArray((nx + ny) * 5)’
leptonica-1.87.0/src/warper.c:183:1: enter_function: entry to ‘pixRandomHarmonicWarp’
leptonica-1.87.0/src/warper.c:202:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/warper.c:210:5: branch_false: ...to here
leptonica-1.87.0/src/warper.c:211:13: call_function: calling ‘generateRandomNumberArray’ from ‘pixRandomHarmonicWarp’
leptonica-1.87.0/src/warper.c:211:13: return_function: returning to ‘pixRandomHarmonicWarp’ from ‘generateRandomNumberArray’
leptonica-1.87.0/src/warper.c:212:12: throw: if ‘pixCreateTemplate’ throws an exception...
leptonica-1.87.0/src/warper.c:242:31: danger: ‘generateRandomNumberArray((nx + ny) * 5)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#  240|   l_float64  *randa;
#  241|   
#  242|->     if ((randa = (l_float64 *)LEPT_CALLOC(size, sizeof(l_float64))) == NULL)
#  243|           return (l_float64 *)ERROR_PTR("calloc fail for randa", __func__, NULL);
#  244|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2151]
leptonica-1.87.0/src/warper.c:278:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘randa’
leptonica-1.87.0/src/warper.c:183:1: enter_function: entry to ‘pixRandomHarmonicWarp’
leptonica-1.87.0/src/warper.c:202:8: branch_false: following ‘false’ branch...
leptonica-1.87.0/src/warper.c:210:5: branch_false: ...to here
leptonica-1.87.0/src/warper.c:211:13: call_function: calling ‘generateRandomNumberArray’ from ‘pixRandomHarmonicWarp’
leptonica-1.87.0/src/warper.c:211:13: return_function: returning to ‘pixRandomHarmonicWarp’ from ‘generateRandomNumberArray’
leptonica-1.87.0/src/warper.c:218:17: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/warper.c:219:25: branch_true: ...to here
leptonica-1.87.0/src/warper.c:220:21: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/warper.c:221:13: branch_true: ...to here
leptonica-1.87.0/src/warper.c:221:13: call_function: calling ‘applyWarpTransform’ from ‘pixRandomHarmonicWarp’
#  276|           anglex = xfreq * randa[3 * i + 1] * xp + twopi * randa[3 * i + 2];
#  277|           angley = yfreq * randa[3 * i + 3] * yp + twopi * randa[3 * i + 4];
#  278|->         x += xmag * randa[3 * i] * sin(anglex) * sin(angley);
#  279|       }
#  280|       for (i = nx, y = yp; i < nx + ny; i++) {

Error: COMPILER_WARNING (CWE-457): [#def2152]
leptonica-1.87.0/src/watershed.c:412:21: warning[-Wmaybe-uninitialized]: ‘index’ may be used uninitialized
#  412 |         cindex = lut[index];
#      |                     ^
leptonica-1.87.0/src/watershed.c:317:34: note: ‘index’ was declared here
#  317 | l_int32   i, j, val, x, y, w, h, index, mindepth;
#      |                                  ^~~~~
#  410|           else
#  411|               clabel = lut[ulabel];
#  412|->         cindex = lut[index];
#  413|           if (clabel == cindex) continue;  /* have already seen this one */
#  414|           if (clabel == MAX_LABEL_VALUE) {  /* new one; assign index and try to

Error: COMPILER_WARNING (CWE-457): [#def2153]
leptonica-1.87.0/src/watershed.c: scope_hint: In function ‘wshedApply’
leptonica-1.87.0/src/watershed.c:490:51: warning[-Wmaybe-uninitialized]: ‘val’ may be used uninitialized
#  490 |                 wshedSaveBasin(wshed, cindex, val - 1);
#      |                                               ~~~~^~~
leptonica-1.87.0/src/watershed.c:317:17: note: ‘val’ was declared here
#  317 | l_int32   i, j, val, x, y, w, h, index, mindepth;
#      |                 ^~~
#  488|                   debugWshedMerge(wshed, one_new_watershed_index,
#  489|                                   x, y, clabel, cindex);
#  490|->                 wshedSaveBasin(wshed, cindex, val - 1);
#  491|                   numaSetValue(nasi, cindex, 0);
#  492|                   mergeLookup(wshed, cindex, clabel);

Error: CPPCHECK_WARNING (CWE-476): [#def2154]
leptonica-1.87.0/src/watershed.c:836: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: np
#  834|           np = (L_NEWPIXEL *)LEPT_CALLOC(1, sizeof(L_NEWPIXEL));
#  835|   
#  836|->     np->x = x;
#  837|       np->y = y;
#  838|       lqueueAdd(lq, np);

Error: CPPCHECK_WARNING (CWE-476): [#def2155]
leptonica-1.87.0/src/watershed.c:837: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: np
#  835|   
#  836|       np->x = x;
#  837|->     np->y = y;
#  838|       lqueueAdd(lq, np);
#  839|   }

Error: CPPCHECK_WARNING (CWE-476): [#def2156]
leptonica-1.87.0/src/watershed.c:917: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: wsp
#  915|           wsp = (L_WSPIXEL *)LEPT_CALLOC(1, sizeof(L_WSPIXEL));
#  916|   
#  917|->     wsp->val = (l_float32)val;
#  918|       wsp->x = x;
#  919|       wsp->y = y;

Error: CPPCHECK_WARNING (CWE-476): [#def2157]
leptonica-1.87.0/src/watershed.c:918: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: wsp
#  916|   
#  917|       wsp->val = (l_float32)val;
#  918|->     wsp->x = x;
#  919|       wsp->y = y;
#  920|       wsp->index = index;

Error: CPPCHECK_WARNING (CWE-476): [#def2158]
leptonica-1.87.0/src/watershed.c:919: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: wsp
#  917|       wsp->val = (l_float32)val;
#  918|       wsp->x = x;
#  919|->     wsp->y = y;
#  920|       wsp->index = index;
#  921|       lheapAdd(lh, wsp);

Error: CPPCHECK_WARNING (CWE-476): [#def2159]
leptonica-1.87.0/src/watershed.c:920: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: wsp
#  918|       wsp->x = x;
#  919|       wsp->y = y;
#  920|->     wsp->index = index;
#  921|       lheapAdd(lh, wsp);
#  922|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2160]
leptonica-1.87.0/src/zlibmem.c:112:12: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferin’
leptonica-1.87.0/src/zlibmem.c:104:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:108:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:108:27: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:112:12: throw: if ‘bbufferCreate’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:112:12: danger: ‘bufferin’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  110|   
#  111|           /* Set up bbuffers and load bbin with the data */
#  112|->     bbin = bbufferCreate(datain, nin);
#  113|       bbout = bbufferCreate(NULL, 0);
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2161]
leptonica-1.87.0/src/zlibmem.c:112:12: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferout’
leptonica-1.87.0/src/zlibmem.c:104:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:108:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:109:28: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:112:12: throw: if ‘bbufferCreate’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:112:12: danger: ‘bufferout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  110|   
#  111|           /* Set up bbuffers and load bbin with the data */
#  112|->     bbin = bbufferCreate(datain, nin);
#  113|       bbout = bbufferCreate(NULL, 0);
#  114|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2162]
leptonica-1.87.0/src/zlibmem.c:113:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferin’
leptonica-1.87.0/src/zlibmem.c:104:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:108:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:108:27: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:113:13: throw: if ‘bbufferCreate’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:113:13: danger: ‘bufferin’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  111|           /* Set up bbuffers and load bbin with the data */
#  112|       bbin = bbufferCreate(datain, nin);
#  113|->     bbout = bbufferCreate(NULL, 0);
#  114|   
#  115|       success = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2163]
leptonica-1.87.0/src/zlibmem.c:113:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferout’
leptonica-1.87.0/src/zlibmem.c:104:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:108:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:109:28: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:113:13: throw: if ‘bbufferCreate’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:113:13: danger: ‘bufferout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  111|           /* Set up bbuffers and load bbin with the data */
#  112|       bbin = bbufferCreate(datain, nin);
#  113|->     bbout = bbufferCreate(NULL, 0);
#  114|   
#  115|       success = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2164]
leptonica-1.87.0/src/zlibmem.c:117:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferin’
leptonica-1.87.0/src/zlibmem.c:104:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:108:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:108:27: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:116:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:117:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:117:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:117:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:117:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:117:9: danger: ‘bufferin’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  115|       success = TRUE;
#  116|       if (!bufferin || !bufferout || !bbin || !bbout) {
#  117|->         L_ERROR("calloc fail for buffer\n", __func__);
#  118|           success = FALSE;
#  119|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2165]
leptonica-1.87.0/src/zlibmem.c:117:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferout’
leptonica-1.87.0/src/zlibmem.c:104:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:108:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:109:28: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:116:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:117:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:117:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:117:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:117:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:117:9: danger: ‘bufferout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  115|       success = TRUE;
#  116|       if (!bufferin || !bufferout || !bbin || !bbout) {
#  117|->         L_ERROR("calloc fail for buffer\n", __func__);
#  118|           success = FALSE;
#  119|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2166]
leptonica-1.87.0/src/zlibmem.c:170:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferin’
leptonica-1.87.0/src/zlibmem.c:104:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:108:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:108:27: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:116:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:117:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:170:9: throw: if ‘bbufferDestroy’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:170:9: danger: ‘bufferin’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  168|       } else {
#  169|           dataout = NULL;
#  170|->         bbufferDestroy(&bbout);
#  171|       }
#  172|       bbufferDestroy(&bbin);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2167]
leptonica-1.87.0/src/zlibmem.c:170:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferout’
leptonica-1.87.0/src/zlibmem.c:104:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:108:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:109:28: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:116:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:117:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:170:9: throw: if ‘bbufferDestroy’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:170:9: danger: ‘bufferout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  168|       } else {
#  169|           dataout = NULL;
#  170|->         bbufferDestroy(&bbout);
#  171|       }
#  172|       bbufferDestroy(&bbin);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2168]
leptonica-1.87.0/src/zlibmem.c:172:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferin’
leptonica-1.87.0/src/zlibmem.c:104:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:108:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:108:27: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:116:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:117:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:172:5: throw: if ‘bbufferDestroy’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:172:5: danger: ‘bufferin’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  170|           bbufferDestroy(&bbout);
#  171|       }
#  172|->     bbufferDestroy(&bbin);
#  173|       LEPT_FREE(bufferin);
#  174|       LEPT_FREE(bufferout);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2169]
leptonica-1.87.0/src/zlibmem.c:172:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferout’
leptonica-1.87.0/src/zlibmem.c:104:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:108:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:109:28: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:116:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:117:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:172:5: throw: if ‘bbufferDestroy’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:172:5: danger: ‘bufferout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  170|           bbufferDestroy(&bbout);
#  171|       }
#  172|->     bbufferDestroy(&bbin);
#  173|       LEPT_FREE(bufferin);
#  174|       LEPT_FREE(bufferout);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2170]
leptonica-1.87.0/src/zlibmem.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferin’
leptonica-1.87.0/src/zlibmem.c:204:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:208:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:208:27: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:212:12: throw: if ‘bbufferCreate’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:212:12: danger: ‘bufferin’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  210|   
#  211|           /* Set up bbuffers and load bbin with the data */
#  212|->     bbin = bbufferCreate(datain, nin);
#  213|       bbout = bbufferCreate(NULL, 0);
#  214|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2171]
leptonica-1.87.0/src/zlibmem.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferout’
leptonica-1.87.0/src/zlibmem.c:204:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:208:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:209:28: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:212:12: throw: if ‘bbufferCreate’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:212:12: danger: ‘bufferout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  210|   
#  211|           /* Set up bbuffers and load bbin with the data */
#  212|->     bbin = bbufferCreate(datain, nin);
#  213|       bbout = bbufferCreate(NULL, 0);
#  214|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2172]
leptonica-1.87.0/src/zlibmem.c:213:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferin’
leptonica-1.87.0/src/zlibmem.c:204:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:208:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:208:27: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:213:13: throw: if ‘bbufferCreate’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:213:13: danger: ‘bufferin’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
#  211|           /* Set up bbuffers and load bbin with the data */
#  212|       bbin = bbufferCreate(datain, nin);
#  213|->     bbout = bbufferCreate(NULL, 0);
#  214|   
#  215|       success = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2173]
leptonica-1.87.0/src/zlibmem.c:213:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferout’
leptonica-1.87.0/src/zlibmem.c:204:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:208:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:209:28: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:213:13: throw: if ‘bbufferCreate’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:213:13: danger: ‘bufferout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  211|           /* Set up bbuffers and load bbin with the data */
#  212|       bbin = bbufferCreate(datain, nin);
#  213|->     bbout = bbufferCreate(NULL, 0);
#  214|   
#  215|       success = TRUE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2174]
leptonica-1.87.0/src/zlibmem.c:217:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferin’
leptonica-1.87.0/src/zlibmem.c:204:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:208:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:208:27: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:216:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:217:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:217:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:217:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:217:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:217:9: danger: ‘bufferin’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  215|       success = TRUE;
#  216|       if (!bufferin || !bufferout || !bbin || !bbout) {
#  217|->         L_ERROR("calloc fail for buffer\n", __func__);
#  218|           success = FALSE;
#  219|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2175]
leptonica-1.87.0/src/zlibmem.c:217:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferout’
leptonica-1.87.0/src/zlibmem.c:204:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:208:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:209:28: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:216:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:217:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:217:9: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:217:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:217:9: throw: if ‘lept_stderr’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:217:9: danger: ‘bufferout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
#  215|       success = TRUE;
#  216|       if (!bufferin || !bufferout || !bbin || !bbout) {
#  217|->         L_ERROR("calloc fail for buffer\n", __func__);
#  218|           success = FALSE;
#  219|           goto cleanup_arrays;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2176]
leptonica-1.87.0/src/zlibmem.c:270:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferin’
leptonica-1.87.0/src/zlibmem.c:204:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:208:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:208:27: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:216:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:217:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:270:9: throw: if ‘bbufferDestroy’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:270:9: danger: ‘bufferin’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  268|       } else {
#  269|           dataout = NULL;
#  270|->         bbufferDestroy(&bbout);
#  271|       }
#  272|       bbufferDestroy(&bbin);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2177]
leptonica-1.87.0/src/zlibmem.c:270:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferout’
leptonica-1.87.0/src/zlibmem.c:204:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:208:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:209:28: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:216:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:217:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:270:9: throw: if ‘bbufferDestroy’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:270:9: danger: ‘bufferout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2)
#  268|       } else {
#  269|           dataout = NULL;
#  270|->         bbufferDestroy(&bbout);
#  271|       }
#  272|       bbufferDestroy(&bbin);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2178]
leptonica-1.87.0/src/zlibmem.c:272:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferin’
leptonica-1.87.0/src/zlibmem.c:204:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:208:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:208:27: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:216:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:217:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:272:5: throw: if ‘bbufferDestroy’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:272:5: danger: ‘bufferin’ leaks here; was allocated at [(3)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/2)
#  270|           bbufferDestroy(&bbout);
#  271|       }
#  272|->     bbufferDestroy(&bbin);
#  273|       LEPT_FREE(bufferin);
#  274|       LEPT_FREE(bufferout);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2179]
leptonica-1.87.0/src/zlibmem.c:272:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bufferout’
leptonica-1.87.0/src/zlibmem.c:204:8: branch_false: following ‘false’ branch (when ‘datain’ is non-NULL)...
leptonica-1.87.0/src/zlibmem.c:208:27: branch_false: ...to here
leptonica-1.87.0/src/zlibmem.c:209:28: acquire_memory: allocated here
leptonica-1.87.0/src/zlibmem.c:216:8: branch_true: following ‘true’ branch...
leptonica-1.87.0/src/zlibmem.c:217:9: branch_true: ...to here
leptonica-1.87.0/src/zlibmem.c:272:5: throw: if ‘bbufferDestroy’ throws an exception...
leptonica-1.87.0/src/zlibmem.c:272:5: danger: ‘bufferout’ leaks here; was allocated at [(3)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/2)
#  270|           bbufferDestroy(&bbout);
#  271|       }
#  272|->     bbufferDestroy(&bbin);
#  273|       LEPT_FREE(bufferin);
#  274|       LEPT_FREE(bufferout);

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
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-12.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-x86_64
project-nameleptonica-1.87.0-1.fc44
store-results-to/tmp/tmpqvb2zxve/leptonica-1.87.0-1.fc44.tar.xz
time-created2026-01-08 18:47:58
time-finished2026-01-08 18:57:50
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpqvb2zxve/leptonica-1.87.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpqvb2zxve/leptonica-1.87.0-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9