summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-17 10:19:58 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-17 10:19:58 -0700
commit10eecbe868b5c898ea9cd05d014fbf13c29c3a26 (patch)
treea0eee9f752a9e6761e569d0007237a353730c14c /exec.c
parentd14cb47d9e9a10d04b1a7de9d2799fef9b0436e0 (diff)
handle.c: avoid leaks when realloc() fails
Resolves issues reported by Oracle Parfait static analyzer: Error: Memory leak Memory leak [memory-leak] (CWE 401): Memory leak of pointer kclist allocated with malloc((n * 1)) at line 698 of app/xmodmap/handle.c in function 'do_remove'. kclist allocated at line 662 with malloc((n * 1)) kclist leaks when num_kcs != 0 at line 676 and (j + 1) >= num_kcs at line 687 and (nc + num_kcs) > tot at line 691 and (num_kcs - 1) < 0 at line 701. Memory leak [memory-leak] (CWE 401): Memory leak of pointer kclist allocated with malloc((n * 1)) at line 711 of app/xmodmap/handle.c in function 'do_remove'. kclist allocated at line 662 with malloc((n * 1)) kclist leaks when (i + 1) >= n at line 672. Error: Memory leak Memory leak [memory-leak] (CWE 401): Memory leak of pointer kclist allocated with realloc(kclist, (tot * 1)) at line 711 of app/xmodmap/handle.c in function 'do_remove'. kclist allocated at line 693 with realloc(kclist, (tot * 1)) kclist leaks when (num_kcs - 1) < 0 at line 701 and (i + 1) >= n at line 672. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'exec.c')
0 files changed, 0 insertions, 0 deletions