Source: nn
Version: 6.7.3-14
Severity: normal
Tags: patch

Dear Maintainer,

>From 809b3aa962b341be1f9c047bf8c6e2279730239d Mon Sep 17 00:00:00 2001
>From: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
>Date: Fri, 2 Apr 2021 02:35:40 +0000
>Subject: [PATCH] db.c: Add information for the compiler to make analyzing
> execution paths easier

  The compiler option "-fanalyzer" shows:

db.c:1239:12: warning: leak of '<unknown>' [CWE-401] [-Wanalyzer-malloc-leak]
 1239 |     grplist[count] = NULL;
      |            ^
...
           | 1151 |     if (actfp == NULL) {
           |      |        ~
           |      |        |
           |      |        (10) following 'true' branch (when 'actfp' is 
NULL)...
           | 1152 |  nn_exitmsg(1, "could not open .newsrc file %s\n", 
newsrc_file);
           |      |  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           |      |  |
           |      |  (11) ...to here
           |......
           | 1165 |     if (nntp_debug) {

Signed-off-by: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
---
 db.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/db.c b/db.c
index 90221d0..c55fa3f 100644
--- a/db.c
+++ b/db.c
@@ -1216,6 +1216,9 @@ readpartactfile(void)
     if (grplist == NULL) {
        nn_exitmsg(1, "can't create active or group list (%d entries)\n",
                   count + 1);
+/* Give the compiler the information that the program exits with the
+   previous command */
+       exit(1);
     }
 
     /*
-- 
2.30.2



-- System Information:
Debian Release: bullseye/sid
  APT prefers testing-security
  APT policy: (500, 'testing-security'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.24-1 (SMP w/2 CPU threads)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

-- debconf information excluded

-- 
Bjarni I. Gislason

Reply via email to