procps-ng-4.0.4-9.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
procps-ng-4.0.4/library/devname.c:83:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open("/proc/tty/drivers", 0)'
procps-ng-4.0.4/library/devname.c:121:12: enter_function: entry to 'driver_name'
procps-ng-4.0.4/library/devname.c:124:5: branch_true: following 'true' branch...
procps-ng-4.0.4/library/devname.c:124:16: branch_true: ...to here
procps-ng-4.0.4/library/devname.c:124:16: call_function: calling 'load_drivers' from 'driver_name'
#   81|       end = strchr(p, ' ');
#   82|       if(!end) continue;
#   83|->     len = end - p;
#   84|       if (!(tmn = calloc(1, sizeof(tty_map_node))))
#   85|          goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
procps-ng-4.0.4/library/devname.c:116:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open("/proc/tty/drivers", 0)'
procps-ng-4.0.4/library/devname.c:121:12: enter_function: entry to 'driver_name'
procps-ng-4.0.4/library/devname.c:124:5: branch_true: following 'true' branch...
procps-ng-4.0.4/library/devname.c:124:16: branch_true: ...to here
procps-ng-4.0.4/library/devname.c:124:16: call_function: calling 'load_drivers' from 'driver_name'
#  114|     }
#  115|   fail:
#  116|->   if(fd != -1) close(fd);
#  117|     if(!tty_map) tty_map = (tty_map_node *)-1;
#  118|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
procps-ng-4.0.4/library/diskstats.c:335:18: warning[-Wanalyzer-file-leak]: leak of FILE
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  333|       this->type = DISKSTATS_TYPE_PARTITION;
#  334|   
#  335|->     if (!(dirp = opendir(SYSBLOCK_DIR))) {
#  336|           this->type = DISKSTATS_TYPE_DISK;
#  337|           return;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
procps-ng-4.0.4/library/diskstats.c:335:18: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  333|       this->type = DISKSTATS_TYPE_PARTITION;
#  334|   
#  335|->     if (!(dirp = opendir(SYSBLOCK_DIR))) {
#  336|           this->type = DISKSTATS_TYPE_DISK;
#  337|           return;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
procps-ng-4.0.4/library/diskstats.c:335:18: warning[-Wanalyzer-malloc-leak]: leak of 'p'
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:15: acquire_memory: allocated here
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  333|       this->type = DISKSTATS_TYPE_PARTITION;
#  334|   
#  335|->     if (!(dirp = opendir(SYSBLOCK_DIR))) {
#  336|           this->type = DISKSTATS_TYPE_DISK;
#  337|           return;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
procps-ng-4.0.4/library/diskstats.c:335:18: warning[-Wanalyzer-malloc-leak]: leak of 'target'
procps-ng-4.0.4/library/diskstats.c:511:12: enter_function: entry to 'diskstats_read_failed'
procps-ng-4.0.4/library/diskstats.c:530:12: branch_true: following 'true' branch...
procps-ng-4.0.4/library/diskstats.c:532:9: branch_true: ...to here
procps-ng-4.0.4/library/diskstats.c:550:12: branch_false: following 'false' branch (when 'rc == 14')...
procps-ng-4.0.4/library/diskstats.c:554:24: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:555:14: call_function: calling 'node_update' from 'diskstats_read_failed'
#  333|       this->type = DISKSTATS_TYPE_PARTITION;
#  334|   
#  335|->     if (!(dirp = opendir(SYSBLOCK_DIR))) {
#  336|           this->type = DISKSTATS_TYPE_DISK;
#  337|           return;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
procps-ng-4.0.4/library/diskstats.c:339:20: warning[-Wanalyzer-file-leak]: leak of FILE
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  337|           return;
#  338|       }
#  339|->     while ((dent = readdir(dirp))) {
#  340|           if (strcmp(this->name, dent->d_name) == 0) {
#  341|               this->type = DISKSTATS_TYPE_DISK;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
procps-ng-4.0.4/library/diskstats.c:339:20: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  337|           return;
#  338|       }
#  339|->     while ((dent = readdir(dirp))) {
#  340|           if (strcmp(this->name, dent->d_name) == 0) {
#  341|               this->type = DISKSTATS_TYPE_DISK;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
procps-ng-4.0.4/library/diskstats.c:339:20: warning[-Wanalyzer-malloc-leak]: leak of 'opendir("/sys/block")'
procps-ng-4.0.4/library/diskstats.c:511:12: enter_function: entry to 'diskstats_read_failed'
procps-ng-4.0.4/library/diskstats.c:530:12: branch_true: following 'true' branch...
procps-ng-4.0.4/library/diskstats.c:532:9: branch_true: ...to here
procps-ng-4.0.4/library/diskstats.c:550:12: branch_false: following 'false' branch (when 'rc == 14')...
procps-ng-4.0.4/library/diskstats.c:554:24: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:555:14: call_function: calling 'node_update' from 'diskstats_read_failed'
#  337|           return;
#  338|       }
#  339|->     while ((dent = readdir(dirp))) {
#  340|           if (strcmp(this->name, dent->d_name) == 0) {
#  341|               this->type = DISKSTATS_TYPE_DISK;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
procps-ng-4.0.4/library/diskstats.c:339:20: warning[-Wanalyzer-malloc-leak]: leak of 'p'
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:15: acquire_memory: allocated here
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  337|           return;
#  338|       }
#  339|->     while ((dent = readdir(dirp))) {
#  340|           if (strcmp(this->name, dent->d_name) == 0) {
#  341|               this->type = DISKSTATS_TYPE_DISK;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
procps-ng-4.0.4/library/diskstats.c:339:20: warning[-Wanalyzer-malloc-leak]: leak of 'target'
procps-ng-4.0.4/library/diskstats.c:511:12: enter_function: entry to 'diskstats_read_failed'
procps-ng-4.0.4/library/diskstats.c:530:12: branch_true: following 'true' branch...
procps-ng-4.0.4/library/diskstats.c:532:9: branch_true: ...to here
procps-ng-4.0.4/library/diskstats.c:550:12: branch_false: following 'false' branch (when 'rc == 14')...
procps-ng-4.0.4/library/diskstats.c:554:24: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:555:14: call_function: calling 'node_update' from 'diskstats_read_failed'
#  337|           return;
#  338|       }
#  339|->     while ((dent = readdir(dirp))) {
#  340|           if (strcmp(this->name, dent->d_name) == 0) {
#  341|               this->type = DISKSTATS_TYPE_DISK;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
procps-ng-4.0.4/library/diskstats.c:345:5: warning[-Wanalyzer-file-leak]: leak of FILE
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  343|           }
#  344|       }
#  345|->     closedir(dirp);
#  346|   } // end: node_classify
#  347|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
procps-ng-4.0.4/library/diskstats.c:345:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  343|           }
#  344|       }
#  345|->     closedir(dirp);
#  346|   } // end: node_classify
#  347|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
procps-ng-4.0.4/library/diskstats.c:345:5: warning[-Wanalyzer-malloc-leak]: leak of 'p'
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:15: acquire_memory: allocated here
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  343|           }
#  344|       }
#  345|->     closedir(dirp);
#  346|   } // end: node_classify
#  347|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
procps-ng-4.0.4/library/diskstats.c:345:5: warning[-Wanalyzer-malloc-leak]: leak of 'target'
procps-ng-4.0.4/library/diskstats.c:511:12: enter_function: entry to 'diskstats_read_failed'
procps-ng-4.0.4/library/diskstats.c:530:12: branch_true: following 'true' branch...
procps-ng-4.0.4/library/diskstats.c:532:9: branch_true: ...to here
procps-ng-4.0.4/library/diskstats.c:550:12: branch_false: following 'false' branch (when 'rc == 14')...
procps-ng-4.0.4/library/diskstats.c:554:24: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:555:14: call_function: calling 'node_update' from 'diskstats_read_failed'
#  343|           }
#  344|       }
#  345|->     closedir(dirp);
#  346|   } // end: node_classify
#  347|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
procps-ng-4.0.4/library/diskstats.c:381:9: warning[-Wanalyzer-malloc-leak]: leak of 'node'
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  379|           if (strcmp(name, node->name) == 0)
#  380|               break;
#  381|->         node = node->next;
#  382|       }
#  383|       if (node) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def17]
procps-ng-4.0.4/library/diskstats.c:431:30: warning[-Wanalyzer-null-dereference]: dereference of NULL 'stack'
procps-ng-4.0.4/library/diskstats.c:619:12: enter_function: entry to 'diskstats_stacks_fetch'
procps-ng-4.0.4/library/diskstats.c:629:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/diskstats.c:630:36: branch_true: ...to here
procps-ng-4.0.4/library/diskstats.c:630:12: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:632:9: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:634:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:641:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:643:12: branch_true: following 'true' branch (when 'node' is non-NULL)...
procps-ng-4.0.4/library/diskstats.c:644:15: branch_true: ...to here
procps-ng-4.0.4/library/diskstats.c:644:12: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:651:34: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:651:9: call_function: calling 'diskstats_assign_results' from 'diskstats_stacks_fetch'
#  429|           struct dev_node *node)
#  430|   {
#  431|->     struct diskstats_result *this = stack->head;
#  432|   
#  433|       for (;;) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def18]
procps-ng-4.0.4/library/diskstats.c:524:9: warning[-Wanalyzer-file-leak]: leak of FILE
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  522|           return 1;
#  523|   
#  524|->     if (fseek(info->diskstats_fp, 0L, SEEK_SET) == -1)
#  525|           return 1;
#  526|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
procps-ng-4.0.4/library/diskstats.c:524:9: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  522|           return 1;
#  523|   
#  524|->     if (fseek(info->diskstats_fp, 0L, SEEK_SET) == -1)
#  525|           return 1;
#  526|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
procps-ng-4.0.4/library/diskstats.c:524:9: warning[-Wanalyzer-malloc-leak]: leak of 'p'
procps-ng-4.0.4/library/diskstats.c:713:19: enter_function: entry to 'procps_diskstats_new'
procps-ng-4.0.4/library/diskstats.c:730:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:732:15: acquire_memory: allocated here
procps-ng-4.0.4/library/diskstats.c:732:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/diskstats.c:735:5: branch_false: ...to here
procps-ng-4.0.4/library/diskstats.c:741:9: call_function: calling 'diskstats_read_failed' from 'procps_diskstats_new'
#  522|           return 1;
#  523|   
#  524|->     if (fseek(info->diskstats_fp, 0L, SEEK_SET) == -1)
#  525|           return 1;
#  526|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
procps-ng-4.0.4/library/pids.c:1008:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
procps-ng-4.0.4/library/pids.c:1224:19: enter_function: entry to 'procps_pids_new'
procps-ng-4.0.4/library/pids.c:1270:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/pids.c:1272:8: branch_false: following 'false' branch (when 'p' is non-NULL)...
procps-ng-4.0.4/library/pids.c:1277:9: branch_false: ...to here
procps-ng-4.0.4/library/pids.c:1277:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/pids.c:1278:13: branch_true: ...to here
procps-ng-4.0.4/library/pids.c:1278:13: call_function: calling 'pids_items_check_failed' from 'procps_pids_new'
procps-ng-4.0.4/library/pids.c:1278:13: return_function: returning to 'procps_pids_new' from 'pids_items_check_failed'
procps-ng-4.0.4/library/pids.c:1278:12: branch_false: following 'false' branch...
procps-ng-4.0.4/library/pids.c:1283:23: branch_false: ...to here
procps-ng-4.0.4/library/pids.c:1284:26: acquire_memory: allocated here
procps-ng-4.0.4/library/pids.c:1284:12: branch_false: following 'false' branch...
procps-ng-4.0.4/library/pids.c:1288:9: branch_false: ...to here
procps-ng-4.0.4/library/pids.c:1291:14: call_function: calling 'pids_prep_func_array' from 'procps_pids_new'
procps-ng-4.0.4/library/pids.c:1291:14: return_function: returning to 'procps_pids_new' from 'pids_prep_func_array'
procps-ng-4.0.4/library/pids.c:1291:12: branch_true: following 'true' branch...
procps-ng-4.0.4/library/pids.c:1291:12: branch_true: ...to here
procps-ng-4.0.4/library/pids.c:1008:5: danger: '<unknown>' leaks here; was allocated at [(18)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/17)
# 1006|               info->oldflags |= f_stat;
# 1007|       }
# 1008|->     return;
# 1009|   } // end: pids_libflags_set
# 1010|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
procps-ng-4.0.4/library/pids.c:1008:5: warning[-Wanalyzer-malloc-leak]: leak of 'p'
procps-ng-4.0.4/library/pids.c:1224:19: enter_function: entry to 'procps_pids_new'
procps-ng-4.0.4/library/pids.c:1270:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/pids.c:1272:15: acquire_memory: allocated here
procps-ng-4.0.4/library/pids.c:1272:8: branch_false: following 'false' branch (when 'p' is non-NULL)...
procps-ng-4.0.4/library/pids.c:1277:9: branch_false: ...to here
procps-ng-4.0.4/library/pids.c:1277:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/pids.c:1278:13: branch_true: ...to here
procps-ng-4.0.4/library/pids.c:1278:13: call_function: calling 'pids_items_check_failed' from 'procps_pids_new'
procps-ng-4.0.4/library/pids.c:1278:13: return_function: returning to 'procps_pids_new' from 'pids_items_check_failed'
procps-ng-4.0.4/library/pids.c:1278:12: branch_false: following 'false' branch...
procps-ng-4.0.4/library/pids.c:1283:23: branch_false: ...to here
procps-ng-4.0.4/library/pids.c:1284:12: branch_false: following 'false' branch...
procps-ng-4.0.4/library/pids.c:1288:9: branch_false: ...to here
procps-ng-4.0.4/library/pids.c:1291:14: call_function: calling 'pids_prep_func_array' from 'procps_pids_new'
procps-ng-4.0.4/library/pids.c:1291:14: return_function: returning to 'procps_pids_new' from 'pids_prep_func_array'
procps-ng-4.0.4/library/pids.c:1291:12: branch_true: following 'true' branch...
procps-ng-4.0.4/library/pids.c:1291:12: branch_true: ...to here
procps-ng-4.0.4/library/pids.c:1008:5: danger: 'p' leaks here; was allocated at [(4)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/3)
# 1006|               info->oldflags |= f_stat;
# 1007|       }
# 1008|->     return;
# 1009|   } // end: pids_libflags_set
# 1010|   

Error: GCC_ANALYZER_WARNING (CWE-685): [#def23]
procps-ng-4.0.4/library/pids.c:1035:9: warning[-Wanalyzer-va-list-exhausted]: 'vl' has no more arguments (0 consumed)
procps-ng-4.0.4/library/pids.c:1468:34: enter_function: entry to 'procps_pids_reap'
procps-ng-4.0.4/library/pids.c:1476:8: branch_false: following 'false' branch (when 'info' is non-NULL)...
procps-ng-4.0.4/library/pids.c:1478:8: branch_false: ...to here
procps-ng-4.0.4/library/pids.c:1478:8: branch_false: following 'false' branch (when 'which <= 1')...
procps-ng-4.0.4/library/pids.c:1482:10: branch_false: ...to here
procps-ng-4.0.4/library/pids.c:1482:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/pids.c:1484:5: branch_false: ...to here
procps-ng-4.0.4/library/pids.c:1486:10: call_function: calling 'pids_oldproc_open' from 'procps_pids_reap' with 0 variadic arguments
# 1033|       if (*this == NULL) {
# 1034|           va_start(vl, flags);
# 1035|->         ids = va_arg(vl, int*);
# 1036|           if (flags & PROC_UID) num = va_arg(vl, int);
# 1037|           va_end(vl);

Error: COMPILER_WARNING (CWE-704): [#def24]
procps-ng-4.0.4/library/readproc.c: scope_hint: In function 'stat2proc'
procps-ng-4.0.4/library/readproc.c:581:9: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  581 |     tmp = strrchr(S, ')');
#      |         ^
#  579|       if (!S) return 0;
#  580|       S++;
#  581|->     tmp = strrchr(S, ')');
#  582|       if (!tmp || !tmp[1]) return 0;
#  583|   #ifdef FALSE_THREADS

Error: COMPILER_WARNING (CWE-704): [#def25]
procps-ng-4.0.4/library/readproc.c:581:9: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  579|       if (!S) return 0;
#  580|       S++;
#  581|->     tmp = strrchr(S, ')');
#  582|       if (!tmp || !tmp[1]) return 0;
#  583|   #ifdef FALSE_THREADS

Error: COMPILER_WARNING (CWE-704): [#def26]
procps-ng-4.0.4/library/readproc.c: scope_hint: In function 'smaps2proc'
procps-ng-4.0.4/library/readproc.c:709:20: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  709 |         if (!(head = strstr(s, smaptab[i].item)))
#      |                    ^
#  707|       }
#  708|       for (i = 0; i < enMAX; i++) {
#  709|->         if (!(head = strstr(s, smaptab[i].item)))
#  710|               continue;
#  711|           head += smaptab[i].slen;

Error: COMPILER_WARNING (CWE-704): [#def27]
procps-ng-4.0.4/library/readproc.c:709:20: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  707|       }
#  708|       for (i = 0; i < enMAX; i++) {
#  709|->         if (!(head = strstr(s, smaptab[i].item)))
#  710|               continue;
#  711|           head += smaptab[i].slen;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
procps-ng-4.0.4/library/readproc.c:738:21: warning[-Wanalyzer-malloc-leak]: leak of 'ub.buf'
procps-ng-4.0.4/library/readproc.c:1610:5: enter_function: entry to 'look_up_our_self'
procps-ng-4.0.4/library/readproc.c:1616:8: call_function: calling 'file2str' from 'look_up_our_self'
#  736|       len = snprintf(path, sizeof path, "%s/%s", directory, what);
#  737|       if (len <= 0 || (size_t)len >= sizeof path) return -1;
#  738|->     if (-1 == (fd = open(path, O_RDONLY, 0))) return -1;
#  739|       while (0 < (num = read(fd, ub->buf + tot_read, ub->siz - tot_read))) {
#  740|           tot_read += num;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
procps-ng-4.0.4/library/readproc.c:746:14: warning[-Wanalyzer-malloc-leak]: leak of 'ub.buf'
procps-ng-4.0.4/library/readproc.c:1610:5: enter_function: entry to 'look_up_our_self'
procps-ng-4.0.4/library/readproc.c:1616:8: call_function: calling 'file2str' from 'look_up_our_self'
#  744|               break;
#  745|           }
#  746|->         if (!(ub->buf = realloc(ub->buf, (ub->siz += buffGRW)))) {
#  747|               close(fd);
#  748|               return -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
procps-ng-4.0.4/library/readproc.c:752:5: warning[-Wanalyzer-malloc-leak]: leak of 'ub.buf'
procps-ng-4.0.4/library/readproc.c:1610:5: enter_function: entry to 'look_up_our_self'
procps-ng-4.0.4/library/readproc.c:1616:8: call_function: calling 'file2str' from 'look_up_our_self'
#  750|       };
#  751|       ub->buf[tot_read] = '\0';
#  752|->     close(fd);
#  753|       if (tot_read < 1) return -1;
#  754|       return tot_read;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
procps-ng-4.0.4/library/readproc.c:794:13: warning[-Wanalyzer-malloc-leak]: leak of 'rbuf'
procps-ng-4.0.4/library/readproc.c:1253:16: enter_function: entry to 'simple_readtask'
procps-ng-4.0.4/library/readproc.c:1259:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1265:15: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1268:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1274:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1274:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1275:13: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1275:13: call_function: calling 'file2str' from 'simple_readtask'
procps-ng-4.0.4/library/readproc.c:1275:13: return_function: returning to 'simple_readtask' from 'file2str'
procps-ng-4.0.4/library/readproc.c:1275:12: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1279:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1279:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1284:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1284:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1289:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1289:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1309:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1309:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1311:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1311:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1317:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1317:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1318:30: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1318:30: call_function: calling 'file2strvec' from 'simple_readtask'
#  792|           rbuf = realloc(rbuf, tot + n);          /* allocate more memory */
#  793|           if (!rbuf) {
#  794|->             close(fd);
#  795|               return NULL;
#  796|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
procps-ng-4.0.4/library/readproc.c:802:5: warning[-Wanalyzer-malloc-leak]: leak of 'rbuf'
procps-ng-4.0.4/library/readproc.c:1253:16: enter_function: entry to 'simple_readtask'
procps-ng-4.0.4/library/readproc.c:1259:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1265:15: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1268:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1274:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1274:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1275:13: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1275:13: call_function: calling 'file2str' from 'simple_readtask'
procps-ng-4.0.4/library/readproc.c:1275:13: return_function: returning to 'simple_readtask' from 'file2str'
procps-ng-4.0.4/library/readproc.c:1275:12: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1279:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1279:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1284:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1284:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1289:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1289:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1309:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1309:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1311:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1311:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1317:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1317:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1318:30: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1318:30: call_function: calling 'file2strvec' from 'simple_readtask'
#  800|               break;
#  801|       }
#  802|->     close(fd);
#  803|       if (n < 0 || tot <= 0) {       /* error, or nothing read */
#  804|           if (rbuf) free(rbuf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
procps-ng-4.0.4/library/readproc.c:835:1: warning[-Wanalyzer-malloc-leak]: leak of 'p'
procps-ng-4.0.4/library/readproc.c:1253:16: enter_function: entry to 'simple_readtask'
procps-ng-4.0.4/library/readproc.c:1259:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1265:15: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1268:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1274:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1274:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1275:13: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1275:13: call_function: calling 'file2str' from 'simple_readtask'
procps-ng-4.0.4/library/readproc.c:1275:13: return_function: returning to 'simple_readtask' from 'file2str'
procps-ng-4.0.4/library/readproc.c:1275:12: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1279:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1279:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1284:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1284:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1289:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1289:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1309:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1309:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1311:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1311:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1317:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1317:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1318:30: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1318:30: call_function: calling 'file2strvec' from 'simple_readtask'
#  833|       *q = 0;                                     /* null ptr list terminator */
#  834|       return ret;
#  835|-> }
#  836|   
#  837|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
procps-ng-4.0.4/library/readproc.c:835:1: warning[-Wanalyzer-malloc-leak]: leak of 'rbuf'
procps-ng-4.0.4/library/readproc.c:1253:16: enter_function: entry to 'simple_readtask'
procps-ng-4.0.4/library/readproc.c:1259:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1265:15: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1268:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1274:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1274:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1275:13: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1275:13: call_function: calling 'file2str' from 'simple_readtask'
procps-ng-4.0.4/library/readproc.c:1275:13: return_function: returning to 'simple_readtask' from 'file2str'
procps-ng-4.0.4/library/readproc.c:1275:12: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1279:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1279:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1284:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1284:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1289:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1289:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1309:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1309:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1311:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1311:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1317:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1317:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1318:30: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1318:30: call_function: calling 'file2strvec' from 'simple_readtask'
#  833|       *q = 0;                                     /* null ptr list terminator */
#  834|       return ret;
#  835|-> }
#  836|   
#  837|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
procps-ng-4.0.4/library/readproc.c:856:35: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&path, 0)'
procps-ng-4.0.4/library/readproc.c:851:7: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:852:10: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:852:10: acquire_resource: opened here
procps-ng-4.0.4/library/readproc.c:853:7: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:853:7: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:856:35: danger: 'open(&path, 0)' leaks here; was opened at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  854|   
#  855|       for(;;){
#  856|->         ssize_t r = read(fd,dst+n,sz-n);
#  857|           if(r==-1){
#  858|               if(errno==EINTR) continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
procps-ng-4.0.4/library/readproc.c:1558:22: warning[-Wanalyzer-malloc-leak]: leak of 'PT'
procps-ng-4.0.4/library/readproc.c:1538:19: acquire_memory: allocated here
procps-ng-4.0.4/library/readproc.c:1540:8: branch_false: following 'false' branch (when 'PT' is non-NULL)...
procps-ng-4.0.4/library/readproc.c:1542:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1544:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1548:5: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1554:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1558:22: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1558:22: throw: if 'opendir' throws an exception...
procps-ng-4.0.4/library/readproc.c:1558:22: danger: 'PT' leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
# 1556|           PT->finder = listed_nextpid;
# 1557|       }else{
# 1558|->         PT->procfs = opendir("/proc");
# 1559|           if (!PT->procfs) { free(PT); return NULL; }
# 1560|           PT->finder = simple_nextpid;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
procps-ng-4.0.4/library/readproc.c:1582:9: warning[-Wanalyzer-malloc-leak]: leak of 'PT'
procps-ng-4.0.4/library/readproc.c:1538:19: acquire_memory: allocated here
procps-ng-4.0.4/library/readproc.c:1540:8: branch_false: following 'false' branch (when 'PT' is non-NULL)...
procps-ng-4.0.4/library/readproc.c:1542:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1544:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1548:5: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1554:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1555:9: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1565:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1567:14: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1567:13: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1571:5: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1573:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1580:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1580:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1581:23: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1580:9: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1582:9: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1582:9: throw: if 'closedir' throws an exception...
procps-ng-4.0.4/library/readproc.c:1582:9: danger: 'PT' leaks here; was allocated at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
# 1580|       if (!src_buffer
# 1581|       && !(src_buffer = malloc(MAX_BUFSZ))) {
# 1582|->         closedir(PT->procfs);
# 1583|           free(PT);
# 1584|           return NULL;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def38]
procps-ng-4.0.4/library/readproc.c:1582:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
procps-ng-4.0.4/library/readproc.c:1540:8: branch_false: following 'false' branch (when 'PT' is non-NULL)...
procps-ng-4.0.4/library/readproc.c:1542:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1544:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1548:5: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1554:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1555:9: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1565:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1567:14: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1567:13: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1571:5: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1573:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1580:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1580:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1581:23: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1580:9: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1582:9: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1582:9: release_memory: using NULL here
procps-ng-4.0.4/library/readproc.c:1582:9: danger: argument 1 ('*PT.procfs') NULL where non-null expected
# 1580|       if (!src_buffer
# 1581|       && !(src_buffer = malloc(MAX_BUFSZ))) {
# 1582|->         closedir(PT->procfs);
# 1583|           free(PT);
# 1584|           return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
procps-ng-4.0.4/library/readproc.c:1588:9: warning[-Wanalyzer-malloc-leak]: leak of 'PT'
procps-ng-4.0.4/library/readproc.c:1538:19: acquire_memory: allocated here
procps-ng-4.0.4/library/readproc.c:1540:8: branch_false: following 'false' branch (when 'PT' is non-NULL)...
procps-ng-4.0.4/library/readproc.c:1542:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1544:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1548:5: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1554:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1555:9: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1565:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1567:14: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1567:13: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1571:5: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1573:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1580:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1580:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1586:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1586:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1587:23: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1586:9: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1588:9: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1588:9: throw: if 'closedir' throws an exception...
procps-ng-4.0.4/library/readproc.c:1588:9: danger: 'PT' leaks here; was allocated at [(1)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/0)
# 1586|       if (!dst_buffer
# 1587|       && !(dst_buffer = malloc(MAX_BUFSZ))) {
# 1588|->         closedir(PT->procfs);
# 1589|           free(src_buffer);
# 1590|           free(PT);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def40]
procps-ng-4.0.4/library/readproc.c:1588:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
procps-ng-4.0.4/library/readproc.c:1540:8: branch_false: following 'false' branch (when 'PT' is non-NULL)...
procps-ng-4.0.4/library/readproc.c:1542:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1544:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1548:5: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1554:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1555:9: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1565:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1567:14: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1567:13: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1571:5: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1573:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1580:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1580:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/readproc.c:1586:9: branch_false: ...to here
procps-ng-4.0.4/library/readproc.c:1586:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1587:23: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1586:9: branch_true: following 'true' branch...
procps-ng-4.0.4/library/readproc.c:1588:9: branch_true: ...to here
procps-ng-4.0.4/library/readproc.c:1588:9: release_memory: using NULL here
procps-ng-4.0.4/library/readproc.c:1588:9: danger: argument 1 ('*PT.procfs') NULL where non-null expected
# 1586|       if (!dst_buffer
# 1587|       && !(dst_buffer = malloc(MAX_BUFSZ))) {
# 1588|->         closedir(PT->procfs);
# 1589|           free(src_buffer);
# 1590|           free(PT);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def41]
procps-ng-4.0.4/library/stat.c:725:5: warning[-Wanalyzer-file-leak]: leak of FILE
procps-ng-4.0.4/library/stat.c:1063:19: enter_function: entry to 'procps_stat_new'
procps-ng-4.0.4/library/stat.c:1080:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1082:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1084:25: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1084:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1088:5: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1103:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1112:9: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1112:9: call_function: calling 'stat_read_failed' from 'procps_stat_new'
#  723|       && (!(info->stat_fp = fopen(STAT_FILE, "r"))))
#  724|           return 1;
#  725|->     fflush(info->stat_fp);
#  726|       rewind(info->stat_fp);
#  727|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
procps-ng-4.0.4/library/stat.c:725:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
procps-ng-4.0.4/library/stat.c:1063:19: enter_function: entry to 'procps_stat_new'
procps-ng-4.0.4/library/stat.c:1080:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1082:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1084:25: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1084:25: acquire_memory: allocated here
procps-ng-4.0.4/library/stat.c:1084:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1088:5: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1103:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1112:9: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1112:9: call_function: calling 'stat_read_failed' from 'procps_stat_new'
#  723|       && (!(info->stat_fp = fopen(STAT_FILE, "r"))))
#  724|           return 1;
#  725|->     fflush(info->stat_fp);
#  726|       rewind(info->stat_fp);
#  727|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
procps-ng-4.0.4/library/stat.c:725:5: warning[-Wanalyzer-malloc-leak]: leak of 'p'
procps-ng-4.0.4/library/stat.c:1063:19: enter_function: entry to 'procps_stat_new'
procps-ng-4.0.4/library/stat.c:1080:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1082:15: acquire_memory: allocated here
procps-ng-4.0.4/library/stat.c:1082:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1084:25: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1084:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1088:5: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1103:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1112:9: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1112:9: call_function: calling 'stat_read_failed' from 'procps_stat_new'
#  723|       && (!(info->stat_fp = fopen(STAT_FILE, "r"))))
#  724|           return 1;
#  725|->     fflush(info->stat_fp);
#  726|       rewind(info->stat_fp);
#  727|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def44]
procps-ng-4.0.4/library/stat.c:726:5: warning[-Wanalyzer-file-leak]: leak of FILE
procps-ng-4.0.4/library/stat.c:1063:19: enter_function: entry to 'procps_stat_new'
procps-ng-4.0.4/library/stat.c:1080:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1082:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1084:25: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1084:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1088:5: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1103:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1112:9: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1112:9: call_function: calling 'stat_read_failed' from 'procps_stat_new'
#  724|           return 1;
#  725|       fflush(info->stat_fp);
#  726|->     rewind(info->stat_fp);
#  727|   
#  728|    #define maxSIZ    info->stat_buf_size

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
procps-ng-4.0.4/library/stat.c:726:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
procps-ng-4.0.4/library/stat.c:1063:19: enter_function: entry to 'procps_stat_new'
procps-ng-4.0.4/library/stat.c:1080:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1082:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1084:25: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1084:25: acquire_memory: allocated here
procps-ng-4.0.4/library/stat.c:1084:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1088:5: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1103:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1112:9: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1112:9: call_function: calling 'stat_read_failed' from 'procps_stat_new'
#  724|           return 1;
#  725|       fflush(info->stat_fp);
#  726|->     rewind(info->stat_fp);
#  727|   
#  728|    #define maxSIZ    info->stat_buf_size

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
procps-ng-4.0.4/library/stat.c:726:5: warning[-Wanalyzer-malloc-leak]: leak of 'p'
procps-ng-4.0.4/library/stat.c:1063:19: enter_function: entry to 'procps_stat_new'
procps-ng-4.0.4/library/stat.c:1080:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1082:15: acquire_memory: allocated here
procps-ng-4.0.4/library/stat.c:1082:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1084:25: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1084:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1088:5: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1103:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1112:9: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1112:9: call_function: calling 'stat_read_failed' from 'procps_stat_new'
#  724|           return 1;
#  725|       fflush(info->stat_fp);
#  726|->     rewind(info->stat_fp);
#  727|   
#  728|    #define maxSIZ    info->stat_buf_size

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
procps-ng-4.0.4/library/stat.c:741:14: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
procps-ng-4.0.4/library/stat.c:1063:19: enter_function: entry to 'procps_stat_new'
procps-ng-4.0.4/library/stat.c:1080:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1082:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1084:25: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1084:25: acquire_memory: allocated here
procps-ng-4.0.4/library/stat.c:1084:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1088:5: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1103:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1112:9: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1112:9: call_function: calling 'stat_read_failed' from 'procps_stat_new'
#  739|               break;
#  740|           maxSIZ += BUFFER_INCR;
#  741|->         if (!(info->stat_buf = realloc(info->stat_buf, maxSIZ)))
#  742|               return 1;
#  743|       };

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
procps-ng-4.0.4/library/stat.c:1100:5: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
procps-ng-4.0.4/library/stat.c:1080:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1082:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1084:25: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1084:25: acquire_memory: allocated here
procps-ng-4.0.4/library/stat.c:1084:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1088:5: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1100:5: throw: if 'numa_init' throws an exception...
procps-ng-4.0.4/library/stat.c:1100:5: danger: '<unknown>' leaks here; was allocated at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
# 1098|       p->select.items = &p->select_items;
# 1099|   
# 1100|->     numa_init();
# 1101|   
# 1102|       // identify the current P-cores and E-cores, if any

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
procps-ng-4.0.4/library/stat.c:1100:5: warning[-Wanalyzer-malloc-leak]: leak of 'p'
procps-ng-4.0.4/library/stat.c:1080:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1082:15: acquire_memory: allocated here
procps-ng-4.0.4/library/stat.c:1082:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1084:25: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1084:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1088:5: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1100:5: throw: if 'numa_init' throws an exception...
procps-ng-4.0.4/library/stat.c:1100:5: danger: 'p' leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
# 1098|       p->select.items = &p->select_items;
# 1099|   
# 1100|->     numa_init();
# 1101|   
# 1102|       // identify the current P-cores and E-cores, if any

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
procps-ng-4.0.4/library/stat.c:1187:9: warning[-Wanalyzer-malloc-leak]: leak of 'p'
procps-ng-4.0.4/library/stat.c:1063:19: enter_function: entry to 'procps_stat_new'
procps-ng-4.0.4/library/stat.c:1080:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1082:15: acquire_memory: allocated here
procps-ng-4.0.4/library/stat.c:1082:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1084:25: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1084:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/stat.c:1088:5: branch_false: ...to here
procps-ng-4.0.4/library/stat.c:1103:10: call_function: calling 'stat_cores_verify' from 'procps_stat_new'
procps-ng-4.0.4/library/stat.c:1103:10: return_function: returning to 'procps_stat_new' from 'stat_cores_verify'
procps-ng-4.0.4/library/stat.c:1103:8: branch_true: following 'true' branch...
procps-ng-4.0.4/library/stat.c:1104:9: branch_true: ...to here
procps-ng-4.0.4/library/stat.c:1104:9: call_function: calling 'procps_stat_unref' from 'procps_stat_new'
# 1185|           }
# 1186|   
# 1187|->         numa_uninit();
# 1188|   
# 1189|           free(*info);

Error: GCC_ANALYZER_WARNING (CWE-787): [#def51]
procps-ng-4.0.4/library/uptime.c:228:16: warning[-Wanalyzer-out-of-bounds]: buffer overflow
procps-ng-4.0.4/library/uptime.c:179:8: branch_false: following 'false' branch...
procps-ng-4.0.4/library/uptime.c:182:9: branch_false: ...to here
procps-ng-4.0.4/library/uptime.c:227:8: branch_true: following 'true' branch (when 'updecades != 0')...
procps-ng-4.0.4/library/uptime.c:228:16: branch_true: ...to here
procps-ng-4.0.4/library/uptime.c:228:16: danger: out-of-bounds write from byte 256 till byte 258 but 'shortbuf' ends at byte 256
#  226|   
#  227|       if (updecades) {
#  228|->         pos += sprintf(shortbuf + pos, "%d %s",
#  229|                          updecades, updecades > 1 ? "decades" : "decade");
#  230|           comma += 1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
procps-ng-4.0.4/library/wchan.c:42:4: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&buf, 0)'
procps-ng-4.0.4/library/wchan.c:38:9: acquire_resource: opened here
procps-ng-4.0.4/library/wchan.c:39:7: branch_false: following 'false' branch...
procps-ng-4.0.4/library/wchan.c:41:10: branch_false: ...to here
procps-ng-4.0.4/library/wchan.c:42:4: danger: 'open(&buf, 0)' leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   40|   
#   41|      num = read(fd, buf, sizeof buf - 1);
#   42|->    close(fd);
#   43|   
#   44|      if (num<1) return "?"; // allow for "0"

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
procps-ng-4.0.4/local/signals.c:290:1: warning[-Wanalyzer-malloc-leak]: leak of ‘copy’
procps-ng-4.0.4/local/signals.c:256:12: acquire_memory: allocated here
procps-ng-4.0.4/local/signals.c:257:8: branch_false: following ‘false’ branch (when ‘copy’ is non-NULL)...
procps-ng-4.0.4/local/signals.c:257:8: branch_false: ...to here
procps-ng-4.0.4/local/signals.c:259:20: branch_true: following ‘true’ branch...
procps-ng-4.0.4/local/signals.c:260:14: branch_true: ...to here
procps-ng-4.0.4/local/signals.c:259:20: branch_true: following ‘true’ branch...
procps-ng-4.0.4/local/signals.c:260:14: branch_true: ...to here
procps-ng-4.0.4/local/signals.c:259:20: branch_true: following ‘true’ branch...
procps-ng-4.0.4/local/signals.c:260:14: branch_true: ...to here
procps-ng-4.0.4/local/signals.c:262:8: branch_true: following ‘true’ branch...
procps-ng-4.0.4/local/signals.c:264:8: branch_true: following ‘true’ branch...
procps-ng-4.0.4/local/signals.c:265:21: branch_true: ...to here
procps-ng-4.0.4/local/signals.c:290:1: danger: ‘copy’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  288|       free(copy);
#  289|       return converted;
#  290|-> }
#  291|   
#  292|   void unix_print_signals(void)

Error: GCC_ANALYZER_WARNING (CWE-479): [#def54]
procps-ng-4.0.4/local/xalloc.h:25:21: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘malloc’ from within signal handler
procps-ng-4.0.4/src/tload.c:63:13: enter_function: entry to ‘setsize’
procps-ng-4.0.4/src/tload.c:74:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/tload.c:76:13: branch_false: ...to here
procps-ng-4.0.4/src/tload.c:76:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/tload.c:81:12: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/tload.c:82:34: branch_true: ...to here
procps-ng-4.0.4/src/tload.c:82:34: call_function: calling ‘xmalloc’ from ‘setsize’
#   23|   void *xmalloc(const size_t size)
#   24|   {
#   25|-> 	void *ret = malloc(size);
#   26|   	if (!ret && size)
#   27|   		xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
procps-ng-4.0.4/local/xalloc.h:26:13: warning[-Wanalyzer-malloc-leak]: leak of ‘do_one_spec(walk,  equal_loc)’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#   24|   {
#   25|   	void *ret = malloc(size);
#   26|-> 	if (!ret && size)
#   27|   		xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   28|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
procps-ng-4.0.4/local/xalloc.h:26:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)argc * 4)’
procps-ng-4.0.4/src/pmap.c:1020:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pmap.c:1049:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/pmap.c:1049:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1107:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1110:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1110:13: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1113:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1113:13: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1116:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1116:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1125:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1125:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1140:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1140:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
procps-ng-4.0.4/src/pmap.c:1143:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1143:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1145:13: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1162:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1164:13: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1164:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1166:19: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1166:19: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/pmap.c:1166:19: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/pmap.c:1169:16: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/pmap.c:1170:31: branch_true: ...to here
procps-ng-4.0.4/local/xalloc.h:26:13: danger: ‘xmalloc((long unsigned int)argc * 4)’ leaks here; was allocated at [(24)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/23)
#   24|   {
#   25|   	void *ret = malloc(size);
#   26|-> 	if (!ret && size)
#   27|   		xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   28|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
procps-ng-4.0.4/local/xalloc.h:26:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(16)’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/local/xalloc.h:26:13: danger: ‘xmalloc(16)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#   24|   {
#   25|   	void *ret = malloc(size);
#   26|-> 	if (!ret && size)
#   27|   		xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   28|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
procps-ng-4.0.4/local/xalloc.h:26:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(40)’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#   24|   {
#   25|   	void *ret = malloc(size);
#   26|-> 	if (!ret && size)
#   27|   		xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   28|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
procps-ng-4.0.4/local/xalloc.h:26:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(strlen(*<unknown>) + 11)’
procps-ng-4.0.4/src/pwdx.c:68:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pwdx.c:89:16: branch_false: following ‘false’ branch (when ‘ch == -1’)...
procps-ng-4.0.4/src/pwdx.c:100:14: branch_false: ...to here
procps-ng-4.0.4/src/pwdx.c:103:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
procps-ng-4.0.4/src/pwdx.c:106:19: branch_false: ...to here
procps-ng-4.0.4/src/pwdx.c:106:19: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/pwdx.c:106:19: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/pwdx.c:108:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
procps-ng-4.0.4/src/pwdx.c:113:42: branch_true: ...to here
procps-ng-4.0.4/src/pwdx.c:114:23: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/pwdx.c:114:23: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/local/xalloc.h:26:13: danger: ‘xmalloc(strlen(*<unknown>) + 11)’ leaks here; was allocated at [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14)
#   24|   {
#   25|   	void *ret = malloc(size);
#   26|-> 	if (!ret && size)
#   27|   		xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   28|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
procps-ng-4.0.4/local/xalloc.h:26:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(strlen(path) + strlen(&*<unknown>.d_name) + 2)’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:1027:17: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:1027:17: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:1029:12: branch_true: following ‘true’ branch (when ‘DisplayAllOpt != 0’)...
procps-ng-4.0.4/src/sysctl.c:1030:24: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1030:24: call_function: calling ‘DisplayAll’ from ‘main’
#   24|   {
#   25|   	void *ret = malloc(size);
#   26|-> 	if (!ret && size)
#   27|   		xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   28|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-415): [#def61]
procps-ng-4.0.4/local/xalloc.h:34:21: warning[-Wanalyzer-double-free]: double-‘free’ of ‘ptr’
procps-ng-4.0.4/src/pidof.c:302:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pidof.c:334:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
procps-ng-4.0.4/src/pidof.c:335:17: branch_true: ...to here
procps-ng-4.0.4/src/pidof.c:352:28: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/pidof.c:353:33: branch_true: ...to here
procps-ng-4.0.4/src/pidof.c:354:33: release_memory: first ‘free’ here
procps-ng-4.0.4/src/pidof.c:354:33: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pidof.c:355:55: branch_false: ...to here
procps-ng-4.0.4/src/pidof.c:355:46: call_function: calling ‘pid_link’ from ‘main’
procps-ng-4.0.4/src/pidof.c:355:46: return_function: returning to ‘main’ from ‘pid_link’
procps-ng-4.0.4/src/pidof.c:334:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
procps-ng-4.0.4/src/pidof.c:335:17: branch_true: ...to here
procps-ng-4.0.4/src/pidof.c:352:28: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/pidof.c:353:33: branch_true: ...to here
procps-ng-4.0.4/src/pidof.c:354:33: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pidof.c:355:55: branch_false: ...to here
procps-ng-4.0.4/src/pidof.c:355:46: call_function: calling ‘pid_link’ from ‘main’
#   32|   void *xrealloc(void *ptr, const size_t size)
#   33|   {
#   34|-> 	void *ret = realloc(ptr, size);
#   35|   	if (!ret && size)
#   36|   		xerrx(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
procps-ng-4.0.4/src/pgrep.c:223:13: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
procps-ng-4.0.4/src/pgrep.c:1123:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pgrep.c:1144:5: call_function: calling ‘parse_opts’ from ‘main’
#  221|           struct pids_info *info = NULL;
#  222|   
#  223|->         if (procps_pids_new(&info, Items, 16) < 0)
#  224|               xerrx(EXIT_FATAL, _("Unable to create pid info structure"));
#  225|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
procps-ng-4.0.4/src/pgrep.c:232:25: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
procps-ng-4.0.4/src/pgrep.c:1123:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pgrep.c:1144:5: call_function: calling ‘parse_opts’ from ‘main’
#  230|   
#  231|           done = 1;
#  232|->         while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY))) {
#  233|               if (PIDS_GETINT(PID) == search_pid) {
#  234|                   list[++i].num = PIDS_GETINT(PPID);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
procps-ng-4.0.4/src/pgrep.c:241:9: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
procps-ng-4.0.4/src/pgrep.c:1123:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pgrep.c:1144:5: call_function: calling ‘parse_opts’ from ‘main’
#  239|           }
#  240|   
#  241|->         procps_pids_unref(&info);
#  242|       }
#  243|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
procps-ng-4.0.4/src/pgrep.c:460:10: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
procps-ng-4.0.4/src/pgrep.c:1123:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pgrep.c:1144:5: call_function: calling ‘parse_opts’ from ‘main’
#  458|   
#  459|       ns_flags = 0;
#  460|->     id = procps_ns_get_id(name);
#  461|       if (id < 0)
#  462|           return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
procps-ng-4.0.4/src/pgrep.c:460:10: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
procps-ng-4.0.4/src/pgrep.c:1123:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pgrep.c:1144:5: call_function: calling ‘parse_opts’ from ‘main’
#  458|   
#  459|       ns_flags = 0;
#  460|->     id = procps_ns_get_id(name);
#  461|       if (id < 0)
#  462|           return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
procps-ng-4.0.4/src/pgrep.c:460:10: warning[-Wanalyzer-malloc-leak]: leak of ‘ptr’
procps-ng-4.0.4/src/pgrep.c:1123:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pgrep.c:1144:5: call_function: calling ‘parse_opts’ from ‘main’
#  458|   
#  459|       ns_flags = 0;
#  460|->     id = procps_ns_get_id(name);
#  461|       if (id < 0)
#  462|           return 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def68]
procps-ng-4.0.4/src/pidof.c:112:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pos’
procps-ng-4.0.4/src/pidof.c:302:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pidof.c:384:16: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/pidof.c:386:32: branch_true: ...to here
procps-ng-4.0.4/src/pidof.c:390:17: call_function: calling ‘select_procs’ from ‘main’
#  110|   
#  111|   	pos = result = filename;
#  112|-> 	while (*pos != '\0') {
#  113|   		if (*(pos++) == '/') result = pos;
#  114|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def69]
procps-ng-4.0.4/src/pmap.c:215:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/proc/self/maps", "r")’
procps-ng-4.0.4/src/pmap.c:1020:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pmap.c:1049:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/pmap.c:1049:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1107:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1110:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1110:13: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1113:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1113:13: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1116:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1116:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1125:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1125:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1140:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1140:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
procps-ng-4.0.4/src/pmap.c:1143:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1143:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1145:13: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1162:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1164:13: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1164:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1166:19: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1166:19: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/pmap.c:1166:19: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/pmap.c:1187:9: call_function: calling ‘discover_shm_minor’ from ‘main’
#  213|   
#  214|   	if (shmdt(addr))
#  215|-> 		perror(_("shared memory detach"));
#  216|   
#  217|   out_destroy:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
procps-ng-4.0.4/src/pmap.c:215:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/proc/self/maps", "r")’
procps-ng-4.0.4/src/pmap.c:1020:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pmap.c:1049:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/pmap.c:1049:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1107:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1110:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1110:13: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1113:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1113:13: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1116:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1116:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1125:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1125:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1140:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1140:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
procps-ng-4.0.4/src/pmap.c:1143:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1143:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1145:13: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1162:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1164:13: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1164:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1166:19: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1166:19: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/pmap.c:1166:19: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/pmap.c:1187:9: call_function: calling ‘discover_shm_minor’ from ‘main’
#  213|   
#  214|   	if (shmdt(addr))
#  215|-> 		perror(_("shared memory detach"));
#  216|   
#  217|   out_destroy:

Error: CPPCHECK_WARNING (CWE-415): [#def71]
procps-ng-4.0.4/src/pmap.c:789: error[doubleFree]: Memory pointed to by 'buf' is freed twice.
#  787|   		      optarg);
#  788|       }
#  789|->     free(buf);
#  790|   }
#  791|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def72]
procps-ng-4.0.4/src/pmap.c:1184:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc((long unsigned int)argc * 4)’
procps-ng-4.0.4/src/pmap.c:1020:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/pmap.c:1049:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/pmap.c:1049:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1107:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1110:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1110:13: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1113:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1113:13: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1116:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1116:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1125:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1125:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1140:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1140:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
procps-ng-4.0.4/src/pmap.c:1143:12: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1143:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1145:13: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1162:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1164:13: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1164:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1166:19: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1166:19: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/pmap.c:1166:19: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/pmap.c:1169:16: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/pmap.c:1170:31: branch_true: ...to here
procps-ng-4.0.4/src/pmap.c:1179:20: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1181:23: branch_false: ...to here
procps-ng-4.0.4/src/pmap.c:1182:20: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/pmap.c:1184:17: danger: ‘xmalloc((long unsigned int)argc * 4) + (long unsigned int)user_count * 4’ could be NULL: unchecked value from [(24)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/23)
# 1182|   		if (pid < 1ul || pid > 0x7ffffffful || *endp)
# 1183|   			usage(stderr);
# 1184|-> 		pidlist[user_count++] = pid;
# 1185|   	}
# 1186|   

Error: COMPILER_WARNING (CWE-704): [#def73]
procps-ng-4.0.4/src/ps/global.c: scope_hint: In function ‘set_personality’
procps-ng-4.0.4/src/ps/global.c:368:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  368 |   found = bsearch(&findme, personality_table, personality_table_count,
#      |         ^
#  366|     }
#  367|   
#  368|->   found = bsearch(&findme, personality_table, personality_table_count,
#  369|         sizeof(personality_table_struct), compare_personality_table_structs
#  370|     );

Error: COMPILER_WARNING (CWE-704): [#def74]
procps-ng-4.0.4/src/ps/global.c:368:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  366|     }
#  367|   
#  368|->   found = bsearch(&findme, personality_table, personality_table_count,
#  369|         sizeof(personality_table_struct), compare_personality_table_structs
#  370|     );

Error: CPPCHECK_WARNING (CWE-457): [#def75]
procps-ng-4.0.4/src/ps/output.c:2100: error[uninitvar]: Uninitialized variables: &key.head, &key.pr, &key.sr, &key.width, &key.vendor, &key.flags
# 2098|     format_struct key;
# 2099|     key.spec = findme;
# 2100|->   return bsearch(&key, format_array, format_array_count,
# 2101|       sizeof(format_struct), compare_format_structs
# 2102|     );

Error: CPPCHECK_WARNING (CWE-457): [#def76]
procps-ng-4.0.4/src/ps/output.c:2108: error[uninitvar]: Uninitialized variable: &key.head
# 2106|     macro_struct key;
# 2107|     key.spec = findme;
# 2108|->   return bsearch(&key, macro_array, macro_array_count,
# 2109|       sizeof(macro_struct), compare_macro_structs
# 2110|     );

Error: COMPILER_WARNING (CWE-704): [#def77]
procps-ng-4.0.4/src/ps/parser.c: scope_hint: In function ‘parse_gnu_option’
procps-ng-4.0.4/src/ps/parser.c:852:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  852 |   found = bsearch(&findme, gnu_table, gnu_table_count,
#      |         ^
#  850|     flagptr = s+sl;
#  851|   
#  852|->   found = bsearch(&findme, gnu_table, gnu_table_count,
#  853|         sizeof(gnu_table_struct), compare_gnu_table_structs
#  854|     );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
procps-ng-4.0.4/src/ps/sortformat.c:49:8: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#   47|     const macro_struct *ms;
#   48|   
#   49|->   fs = search_format_array(spec);
#   50|     if(fs){
#   51|       int w1, w2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
procps-ng-4.0.4/src/ps/sortformat.c:49:8: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#   47|     const macro_struct *ms;
#   48|   
#   49|->   fs = search_format_array(spec);
#   50|     if(fs){
#   51|       int w1, w2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
procps-ng-4.0.4/src/ps/sortformat.c:49:8: warning[-Wanalyzer-malloc-leak]: leak of ‘list’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#   47|     const macro_struct *ms;
#   48|   
#   49|->   fs = search_format_array(spec);
#   50|     if(fs){
#   51|       int w1, w2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
procps-ng-4.0.4/src/ps/sortformat.c:55:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#   53|       thisnode = xmalloc(sizeof(format_node));
#   54|       if(fs->flags & CF_PIDMAX){
#   55|->       w1 = (int)procps_pid_length();
#   56|         w2 = strlen(fs->head);
#   57|         if(w2>w1) w1=w2; // FIXME w/ separate header/body column sizing

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
procps-ng-4.0.4/src/ps/sortformat.c:77:8: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#   75|   
#   76|     /* That failed, so try it as a macro. */
#   77|->   ms = search_macro_array(spec);
#   78|     if(ms){
#   79|       format_node *list = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def83]
procps-ng-4.0.4/src/ps/sortformat.c:90:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘list’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#   88|         buf[dist] = '\0';
#   89|         newnode = do_one_spec(buf,override); /* call self, assume success */
#   90|->       newnode->next = list;
#   91|         list = newnode;
#   92|         walk += dist;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
procps-ng-4.0.4/src/ps/sortformat.c:170:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#  168|         if(*walk == '%')
#  169|           return _("missing AIX field descriptor");
#  170|->       aix = search_aix_array(*walk);
#  171|         walk++;
#  172|         if(!aix){

Error: GCC_ANALYZER_WARNING (CWE-688): [#def85]
procps-ng-4.0.4/src/ps/sortformat.c:184:7: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#  182|         size_t len;
#  183|         len = strcspn(walk, "%");
#  184|->       memcpy(buf,walk,len);
#  185|         buf[len] = '\0';
#  186|         walk += len;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def86]
procps-ng-4.0.4/src/ps/sortformat.c:228:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘walk’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#  226|     walk = buf;
#  227|     do{
#  228|->     switch(*walk){
#  229|       case ' ': case ',': case '\t': case '\n': case '\0':
#  230|       /* Linux extension: allow \t and \n as delimiters */

Error: CPPCHECK_WARNING (CWE-682): [#def87]
procps-ng-4.0.4/src/ps/sortformat.c:241: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  239|         need_item=0;
#  240|       }
#  241|->   } while (*++walk);
#  242|   
#  243|     if(!items){

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
procps-ng-4.0.4/src/ps/sortformat.c:301:29: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
procps-ng-4.0.4/src/ps/sortformat.c:751:13: enter_function: entry to ‘process_sf_options’
procps-ng-4.0.4/src/ps/sortformat.c:754:5: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/sortformat.c:756:11: branch_true: ...to here
procps-ng-4.0.4/src/ps/sortformat.c:756:11: call_function: calling ‘parse_O_option’ from ‘process_sf_options’
#  299|         // FIXME: enforce signal width to 8, 9, or 16 (grep: SIGNAL wide_signals)
#  300|         fnode->width = atoi(colon_loc); // already verified to be a number
#  301|->       if(fnode->width <= 0) catastrophic_failure(__FILE__, __LINE__, _("please report this bug"));
#  302|       }
#  303|       endp = fnode; while(endp->next) endp = endp->next;  /* find end */

Error: CPPCHECK_WARNING (CWE-682): [#def89]
procps-ng-4.0.4/src/ps/sortformat.c:379: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  377|         need_item=0;
#  378|       }
#  379|->   } while (*++walk);
#  380|     if(!items){
#  381|       free(buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def90]
procps-ng-4.0.4/src/ps/stacktrace.c:74:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:74:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:74:5: throw: if ‘perror’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:74:5: danger: ‘in_fd[0]’ leaks here
#   72|   
#   73|     if((pipe (in_fd) == -1) || (pipe (out_fd) == -1)){
#   74|->     perror ("could open pipe");
#   75|       _exit (0);
#   76|     }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def91]
procps-ng-4.0.4/src/ps/stacktrace.c:74:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:74:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:74:5: throw: if ‘perror’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:74:5: danger: ‘in_fd[1]’ leaks here
#   72|   
#   73|     if((pipe (in_fd) == -1) || (pipe (out_fd) == -1)){
#   74|->     perror ("could open pipe");
#   75|       _exit (0);
#   76|     }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def92]
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: danger: ‘in_fd[0]’ leaks here
#   78|     pid = fork ();
#   79|     if (pid == 0){
#   80|->     close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|       close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def93]
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: danger: ‘in_fd[1]’ leaks here
#   78|     pid = fork ();
#   79|     if (pid == 0){
#   80|->     close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|       close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def94]
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: danger: ‘out_fd[0]’ leaks here
#   78|     pid = fork ();
#   79|     if (pid == 0){
#   80|->     close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|       close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def95]
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: danger: ‘out_fd[1]’ leaks here
#   78|     pid = fork ();
#   79|     if (pid == 0){
#   80|->     close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|       close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def96]
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: danger: ‘in_fd[0]’ leaks here
#   79|     if (pid == 0){
#   80|       close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|->     close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def97]
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: danger: ‘in_fd[1]’ leaks here
#   79|     if (pid == 0){
#   80|       close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|->     close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def98]
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: danger: ‘out_fd[0]’ leaks here
#   79|     if (pid == 0){
#   80|       close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|->     close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def99]
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:81:5: danger: ‘out_fd[1]’ leaks here
#   79|     if (pid == 0){
#   80|       close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|->     close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: danger: ‘in_fd[0]’ leaks here
#   80|       close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|       close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|->     close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */
#   84|       perror ("exec failed");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def101]
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: danger: ‘in_fd[1]’ leaks here
#   80|       close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|       close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|->     close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */
#   84|       perror ("exec failed");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def102]
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: danger: ‘out_fd[0]’ leaks here
#   80|       close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|       close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|->     close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */
#   84|       perror ("exec failed");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def103]
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:82:5: danger: ‘out_fd[1]’ leaks here
#   80|       close (0); dup (in_fd[0]);   /* set the stdin to the in pipe */
#   81|       close (1); dup (out_fd[1]);  /* set the stdout to the out pipe */
#   82|->     close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */
#   84|       perror ("exec failed");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def104]
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: throw: if ‘perror’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: danger: ‘in_fd[0]’ leaks here
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */
#   84|->     perror ("exec failed");
#   85|       _exit (0);
#   86|     } else {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def105]
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: throw: if ‘perror’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: danger: ‘in_fd[1]’ leaks here
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */
#   84|->     perror ("exec failed");
#   85|       _exit (0);
#   86|     } else {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def106]
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: throw: if ‘perror’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: danger: ‘out_fd[0]’ leaks here
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */
#   84|->     perror ("exec failed");
#   85|       _exit (0);
#   86|     } else {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def107]
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_true: following ‘true’ branch (when ‘pid == 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:80:5: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: throw: if ‘perror’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:84:5: danger: ‘out_fd[1]’ leaks here
#   82|       close (2); dup (out_fd[1]);  /* set the stderr to the out pipe */
#   83|       execvp (args[0], args);      /* exec gdb */
#   84|->     perror ("exec failed");
#   85|       _exit (0);
#   86|     } else {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def108]
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_true: following ‘true’ branch (when ‘pid == -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: throw: if ‘perror’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: danger: ‘in_fd[0]’ leaks here
#   86|     } else {
#   87|       if(pid == (pid_t) -1){
#   88|->       perror ("could not fork");
#   89|         _exit (0);
#   90|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def109]
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_true: following ‘true’ branch (when ‘pid == -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: throw: if ‘perror’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: danger: ‘in_fd[1]’ leaks here
#   86|     } else {
#   87|       if(pid == (pid_t) -1){
#   88|->       perror ("could not fork");
#   89|         _exit (0);
#   90|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def110]
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_true: following ‘true’ branch (when ‘pid == -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: throw: if ‘perror’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: danger: ‘out_fd[0]’ leaks here
#   86|     } else {
#   87|       if(pid == (pid_t) -1){
#   88|->       perror ("could not fork");
#   89|         _exit (0);
#   90|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def111]
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_true: following ‘true’ branch (when ‘pid == -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: throw: if ‘perror’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:88:7: danger: ‘out_fd[1]’ leaks here
#   86|     } else {
#   87|       if(pid == (pid_t) -1){
#   88|->       perror ("could not fork");
#   89|         _exit (0);
#   90|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def112]
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: danger: ‘in_fd[0]’ leaks here
#   94|     FD_SET (out_fd[0], &fdset);
#   95|   
#   96|->   write (in_fd[1], "backtrace\n", 10);
#   97|     write (in_fd[1], "p x = 0\n", 8);
#   98|     write (in_fd[1], "quit\n", 5);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def113]
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: danger: ‘in_fd[1]’ leaks here
#   94|     FD_SET (out_fd[0], &fdset);
#   95|   
#   96|->   write (in_fd[1], "backtrace\n", 10);
#   97|     write (in_fd[1], "p x = 0\n", 8);
#   98|     write (in_fd[1], "quit\n", 5);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def114]
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: danger: ‘out_fd[0]’ leaks here
#   94|     FD_SET (out_fd[0], &fdset);
#   95|   
#   96|->   write (in_fd[1], "backtrace\n", 10);
#   97|     write (in_fd[1], "p x = 0\n", 8);
#   98|     write (in_fd[1], "quit\n", 5);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def115]
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:96:3: danger: ‘out_fd[1]’ leaks here
#   94|     FD_SET (out_fd[0], &fdset);
#   95|   
#   96|->   write (in_fd[1], "backtrace\n", 10);
#   97|     write (in_fd[1], "p x = 0\n", 8);
#   98|     write (in_fd[1], "quit\n", 5);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def116]
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: danger: ‘in_fd[0]’ leaks here
#   95|   
#   96|     write (in_fd[1], "backtrace\n", 10);
#   97|->   write (in_fd[1], "p x = 0\n", 8);
#   98|     write (in_fd[1], "quit\n", 5);
#   99|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def117]
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: danger: ‘in_fd[1]’ leaks here
#   95|   
#   96|     write (in_fd[1], "backtrace\n", 10);
#   97|->   write (in_fd[1], "p x = 0\n", 8);
#   98|     write (in_fd[1], "quit\n", 5);
#   99|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def118]
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: danger: ‘out_fd[0]’ leaks here
#   95|   
#   96|     write (in_fd[1], "backtrace\n", 10);
#   97|->   write (in_fd[1], "p x = 0\n", 8);
#   98|     write (in_fd[1], "quit\n", 5);
#   99|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def119]
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:97:3: danger: ‘out_fd[1]’ leaks here
#   95|   
#   96|     write (in_fd[1], "backtrace\n", 10);
#   97|->   write (in_fd[1], "p x = 0\n", 8);
#   98|     write (in_fd[1], "quit\n", 5);
#   99|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def120]
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: danger: ‘in_fd[0]’ leaks here
#   96|     write (in_fd[1], "backtrace\n", 10);
#   97|     write (in_fd[1], "p x = 0\n", 8);
#   98|->   write (in_fd[1], "quit\n", 5);
#   99|   
#  100|     index = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def121]
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: danger: ‘in_fd[1]’ leaks here
#   96|     write (in_fd[1], "backtrace\n", 10);
#   97|     write (in_fd[1], "p x = 0\n", 8);
#   98|->   write (in_fd[1], "quit\n", 5);
#   99|   
#  100|     index = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def122]
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: danger: ‘out_fd[0]’ leaks here
#   96|     write (in_fd[1], "backtrace\n", 10);
#   97|     write (in_fd[1], "p x = 0\n", 8);
#   98|->   write (in_fd[1], "quit\n", 5);
#   99|   
#  100|     index = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def123]
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: throw: if ‘write’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:98:3: danger: ‘out_fd[1]’ leaks here
#   96|     write (in_fd[1], "backtrace\n", 10);
#   97|     write (in_fd[1], "p x = 0\n", 8);
#   98|->   write (in_fd[1], "quit\n", 5);
#   99|   
#  100|     index = 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def124]
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:109:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:111:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:135:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:135:12: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: throw: if ‘select’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: danger: ‘in_fd[0]’ leaks here
#  106|       tv.tv_usec = 0;
#  107|   
#  108|->     sel = select (FD_SETSIZE, &readset, NULL, NULL, &tv);
#  109|       if (sel == -1) break;
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def125]
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: throw: if ‘select’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: danger: ‘in_fd[1]’ leaks here
#  106|       tv.tv_usec = 0;
#  107|   
#  108|->     sel = select (FD_SETSIZE, &readset, NULL, NULL, &tv);
#  109|       if (sel == -1) break;
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def126]
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[index]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: throw: if ‘select’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: danger: ‘in_fd[index]’ leaks here
#  106|       tv.tv_usec = 0;
#  107|   
#  108|->     sel = select (FD_SETSIZE, &readset, NULL, NULL, &tv);
#  109|       if (sel == -1) break;
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def127]
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:109:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:111:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:135:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:135:12: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: throw: if ‘select’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: danger: ‘out_fd[0]’ leaks here
#  106|       tv.tv_usec = 0;
#  107|   
#  108|->     sel = select (FD_SETSIZE, &readset, NULL, NULL, &tv);
#  109|       if (sel == -1) break;
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def128]
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: throw: if ‘select’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: danger: ‘out_fd[1]’ leaks here
#  106|       tv.tv_usec = 0;
#  107|   
#  108|->     sel = select (FD_SETSIZE, &readset, NULL, NULL, &tv);
#  109|       if (sel == -1) break;
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def129]
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[index]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: throw: if ‘select’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:108:11: danger: ‘out_fd[index]’ leaks here
#  106|       tv.tv_usec = 0;
#  107|   
#  108|->     sel = select (FD_SETSIZE, &readset, NULL, NULL, &tv);
#  109|       if (sel == -1) break;
#  110|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def130]
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: danger: ‘in_fd[0]’ leaks here
#  136|     }
#  137|   
#  138|->   close (in_fd[0]);
#  139|     close (in_fd[1]);
#  140|     close (out_fd[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def131]
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: danger: ‘in_fd[1]’ leaks here
#  136|     }
#  137|   
#  138|->   close (in_fd[0]);
#  139|     close (in_fd[1]);
#  140|     close (out_fd[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def132]
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: danger: ‘out_fd[0]’ leaks here
#  136|     }
#  137|   
#  138|->   close (in_fd[0]);
#  139|     close (in_fd[1]);
#  140|     close (out_fd[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def133]
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:138:3: danger: ‘out_fd[1]’ leaks here
#  136|     }
#  137|   
#  138|->   close (in_fd[0]);
#  139|     close (in_fd[1]);
#  140|     close (out_fd[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def134]
procps-ng-4.0.4/src/ps/stacktrace.c:139:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘in_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:139:3: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:139:3: danger: ‘in_fd[1]’ leaks here
#  137|   
#  138|     close (in_fd[0]);
#  139|->   close (in_fd[1]);
#  140|     close (out_fd[0]);
#  141|     close (out_fd[1]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def135]
procps-ng-4.0.4/src/ps/stacktrace.c:139:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:139:3: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:139:3: danger: ‘out_fd[0]’ leaks here
#  137|   
#  138|     close (in_fd[0]);
#  139|->   close (in_fd[1]);
#  140|     close (out_fd[0]);
#  141|     close (out_fd[1]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def136]
procps-ng-4.0.4/src/ps/stacktrace.c:139:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:139:3: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:139:3: danger: ‘out_fd[1]’ leaks here
#  137|   
#  138|     close (in_fd[0]);
#  139|->   close (in_fd[1]);
#  140|     close (out_fd[0]);
#  141|     close (out_fd[1]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def137]
procps-ng-4.0.4/src/ps/stacktrace.c:140:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[0]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:140:3: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:140:3: danger: ‘out_fd[0]’ leaks here
#  138|     close (in_fd[0]);
#  139|     close (in_fd[1]);
#  140|->   close (out_fd[0]);
#  141|     close (out_fd[1]);
#  142|     _exit (0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def138]
procps-ng-4.0.4/src/ps/stacktrace.c:140:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:140:3: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:140:3: danger: ‘out_fd[1]’ leaks here
#  138|     close (in_fd[0]);
#  139|     close (in_fd[1]);
#  140|->   close (out_fd[0]);
#  141|     close (out_fd[1]);
#  142|     _exit (0);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def139]
procps-ng-4.0.4/src/ps/stacktrace.c:141:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘out_fd[1]’
procps-ng-4.0.4/src/ps/stacktrace.c:73:5: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:73:31: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:73:6: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/ps/stacktrace.c:78:9: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:79:6: branch_false: following ‘false’ branch (when ‘pid != 0’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: following ‘false’ branch (when ‘pid != -1’)...
procps-ng-4.0.4/src/ps/stacktrace.c:87:7: branch_false: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: following ‘true’ branch (when ‘__i != 16’)...
procps-ng-4.0.4/src/ps/stacktrace.c:93:3: branch_true: ...to here
procps-ng-4.0.4/src/ps/stacktrace.c:141:3: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/ps/stacktrace.c:141:3: danger: ‘out_fd[1]’ leaks here
#  139|     close (in_fd[1]);
#  140|     close (out_fd[0]);
#  141|->   close (out_fd[1]);
#  142|     _exit (0);
#  143|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
procps-ng-4.0.4/src/skill.c:117:14: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
procps-ng-4.0.4/src/skill.c:395:13: enter_function: entry to ‘parse_options’
procps-ng-4.0.4/src/skill.c:427:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/skill.c:430:5: branch_false: ...to here
procps-ng-4.0.4/src/skill.c:432:8: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/skill.c:433:17: branch_true: ...to here
procps-ng-4.0.4/src/skill.c:433:17: call_function: calling ‘snice_prio_option’ from ‘parse_options’
procps-ng-4.0.4/src/skill.c:433:17: return_function: returning to ‘parse_options’ from ‘snice_prio_option’
procps-ng-4.0.4/src/skill.c:440:12: branch_true: following ‘true’ branch (when ‘ch != -1’)...
procps-ng-4.0.4/src/skill.c:443:9: branch_true: ...to here
procps-ng-4.0.4/src/skill.c:504:17: call_function: calling ‘parse_namespaces’ from ‘parse_options’
#  115|           }
#  116|   
#  117|->         id = procps_ns_get_id(tmp);
#  118|           if (id == -1) {
#  119|               fprintf(stderr, "%s is not a valid namespace\n", tmp);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def141]
procps-ng-4.0.4/src/sysctl.c:172:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc(strlen(key) + 12)’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  170|       /* used to open the file */
#  171|       path = xmalloc(strlen(key) + proc_len + 2);
#  172|->     strcpy(path, PROC_PATH);
#  173|       if (key[0] == '-')
#  174|           strcat(path + proc_len, key+1);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def142]
procps-ng-4.0.4/src/sysctl.c:340:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc(strlen(name) + 12)’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:1027:17: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:1027:17: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:1029:12: branch_true: following ‘true’ branch (when ‘DisplayAllOpt != 0’)...
procps-ng-4.0.4/src/sysctl.c:1030:24: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1030:24: call_function: calling ‘DisplayAll’ from ‘main’
#  338|   	/* used to open the file */
#  339|   	tmpname = xmalloc(strlen(name) + strlen(PROC_PATH) + 2);
#  340|-> 	strcpy(tmpname, PROC_PATH);
#  341|   	strcat(tmpname, name);
#  342|   	/* change . to / */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def143]
procps-ng-4.0.4/src/sysctl.c:495:17: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:1027:17: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:1027:17: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:1029:12: branch_true: following ‘true’ branch (when ‘DisplayAllOpt != 0’)...
procps-ng-4.0.4/src/sysctl.c:1030:24: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1030:24: call_function: calling ‘DisplayAll’ from ‘main’
#  493|   		rc = EXIT_FAILURE;
#  494|   	} else {
#  495|-> 		readdir(dp);	/* skip .  */
#  496|   		readdir(dp);	/* skip .. */
#  497|   		while ((de = readdir(dp))) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def144]
procps-ng-4.0.4/src/sysctl.c:505:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(strlen(path) + strlen(&*<unknown>.d_name) + 2)’ where non-null expected
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:1027:17: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:1027:17: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:1029:12: branch_true: following ‘true’ branch (when ‘DisplayAllOpt != 0’)...
procps-ng-4.0.4/src/sysctl.c:1030:24: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1030:24: call_function: calling ‘DisplayAll’ from ‘main’
#  503|   						     strlen(de->d_name) +
#  504|   						     2);
#  505|-> 			sprintf(tmpdir, "%s%s", path, de->d_name);
#  506|   			rc2 = stat(tmpdir, &ts);
#  507|   			if (rc2 != 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
procps-ng-4.0.4/src/sysctl.c:577:19: warning[-Wanalyzer-malloc-leak]: leak of ‘dotted_key’
procps-ng-4.0.4/src/sysctl.c:543:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/sysctl.c:551:10: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:551:8: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/sysctl.c:556:24: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:556:24: acquire_memory: allocated here
procps-ng-4.0.4/src/sysctl.c:556:8: branch_false: following ‘false’ branch (when ‘dotted_key’ is non-NULL)...
procps-ng-4.0.4/src/sysctl.c:560:5: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:562:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/sysctl.c:569:9: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:569:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/sysctl.c:576:9: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:576:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/sysctl.c:577:19: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:577:19: throw: if ‘fprocopen’ throws an exception...
procps-ng-4.0.4/src/sysctl.c:577:19: danger: ‘dotted_key’ leaks here; was allocated at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
#  575|   
#  576|       if (!DryRun) {
#  577|->         if ((fp = fprocopen(path, "w")) == NULL) {
#  578|               switch (errno) {
#  579|               case ENOENT:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
procps-ng-4.0.4/src/sysctl.c:603:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dotted_key’
procps-ng-4.0.4/src/sysctl.c:543:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/sysctl.c:551:10: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:551:8: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/sysctl.c:556:24: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:556:24: acquire_memory: allocated here
procps-ng-4.0.4/src/sysctl.c:556:8: branch_false: following ‘false’ branch (when ‘dotted_key’ is non-NULL)...
procps-ng-4.0.4/src/sysctl.c:560:5: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:562:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/sysctl.c:569:9: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:569:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/sysctl.c:576:9: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:576:8: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/sysctl.c:577:19: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:577:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/sysctl.c:601:21: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:603:17: throw: if ‘close_stream’ throws an exception...
procps-ng-4.0.4/src/sysctl.c:603:17: danger: ‘dotted_key’ leaks here; was allocated at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
#  601|               if (0 < fprintf(fp, "%s\n", value))
#  602|                   rc = EXIT_SUCCESS;
#  603|->             if (close_stream(fp) != 0) {
#  604|                   xwarn(_("setting key \"%s\""), dotted_key);
#  605|   		free(dotted_key);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def147]
procps-ng-4.0.4/src/sysctl.c:826:27: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  824|   	for (di = 0; di < sizeof(dirs) / sizeof(dirs[0]); ++di) {
#  825|   		struct dirent *de;
#  826|-> 		DIR *dp = opendir(dirs[di]);
#  827|   		if (!dp)
#  828|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def148]
procps-ng-4.0.4/src/sysctl.c:826:27: warning[-Wanalyzer-malloc-leak]: leak of ‘cfgs’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  824|   	for (di = 0; di < sizeof(dirs) / sizeof(dirs[0]); ++di) {
#  825|   		struct dirent *de;
#  826|-> 		DIR *dp = opendir(dirs[di]);
#  827|   		if (!dp)
#  828|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def149]
procps-ng-4.0.4/src/sysctl.c:830:30: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  828|   			continue;
#  829|   
#  830|-> 		while ((de = readdir(dp))) {
#  831|   			if (!strcmp(de->d_name, ".")
#  832|   			    || !strcmp(de->d_name, ".."))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def150]
procps-ng-4.0.4/src/sysctl.c:830:30: warning[-Wanalyzer-malloc-leak]: leak of ‘cfgs’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  828|   			continue;
#  829|   
#  830|-> 		while ((de = readdir(dp))) {
#  831|   			if (!strcmp(de->d_name, ".")
#  832|   			    || !strcmp(de->d_name, ".."))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
procps-ng-4.0.4/src/sysctl.c:830:30: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dirs[di])’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  828|   			continue;
#  829|   
#  830|-> 		while ((de = readdir(dp))) {
#  831|   			if (!strcmp(de->d_name, ".")
#  832|   			    || !strcmp(de->d_name, ".."))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def152]
procps-ng-4.0.4/src/sysctl.c:857:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc((strlen(&*<unknown>.d_name) + 9) * 2 + strlen(dirs[di]) + 1)’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  855|   					    strlen(de->d_name) * 2 + 2 +
#  856|   					    strlen(dirs[di]) + 1);
#  857|-> 				cfgs[ncfgs]->name =
#  858|   				    (char *)cfgs[ncfgs] + sizeof(struct pair);
#  859|   				strcpy(cfgs[ncfgs]->name, de->d_name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
procps-ng-4.0.4/src/sysctl.c:871:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  869|   
#  870|   		}
#  871|-> 		closedir(dp);
#  872|   	}
#  873|   	qsort(cfgs, ncfgs, sizeof(struct cfg *), sortpairs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def154]
procps-ng-4.0.4/src/sysctl.c:871:17: warning[-Wanalyzer-malloc-leak]: leak of ‘cfgs’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  869|   
#  870|   		}
#  871|-> 		closedir(dp);
#  872|   	}
#  873|   	qsort(cfgs, ncfgs, sizeof(struct cfg *), sortpairs);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def155]
procps-ng-4.0.4/src/sysctl.c:873:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  871|   		closedir(dp);
#  872|   	}
#  873|-> 	qsort(cfgs, ncfgs, sizeof(struct cfg *), sortpairs);
#  874|   
#  875|   	for (i = 0; i < ncfgs; ++i) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def156]
procps-ng-4.0.4/src/sysctl.c:873:9: warning[-Wanalyzer-malloc-leak]: leak of ‘cfgs’
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  871|   		closedir(dp);
#  872|   	}
#  873|-> 	qsort(cfgs, ncfgs, sizeof(struct cfg *), sortpairs);
#  874|   
#  875|   	for (i = 0; i < ncfgs; ++i) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def157]
procps-ng-4.0.4/src/sysctl.c:873:9: warning[-Wanalyzer-null-argument]: use of NULL ‘cfgs’ where non-null expected
procps-ng-4.0.4/src/sysctl.c:900:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: call_function: calling ‘xmalloc’ from ‘main’
procps-ng-4.0.4/src/sysctl.c:948:15: return_function: returning to ‘main’ from ‘xmalloc’
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
procps-ng-4.0.4/src/sysctl.c:952:12: branch_false: ...to here
procps-ng-4.0.4/src/sysctl.c:955:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
procps-ng-4.0.4/src/sysctl.c:958:17: branch_true: ...to here
procps-ng-4.0.4/src/sysctl.c:1003:31: call_function: calling ‘PreloadSystem’ from ‘main’
#  871|   		closedir(dp);
#  872|   	}
#  873|-> 	qsort(cfgs, ncfgs, sizeof(struct cfg *), sortpairs);
#  874|   
#  875|   	for (i = 0; i < ncfgs; ++i) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def158]
procps-ng-4.0.4/src/tload.c:86:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
procps-ng-4.0.4/src/tload.c:63:13: enter_function: entry to ‘setsize’
procps-ng-4.0.4/src/tload.c:74:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/tload.c:76:13: branch_false: ...to here
procps-ng-4.0.4/src/tload.c:76:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/tload.c:81:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/tload.c:84:34: branch_false: ...to here
procps-ng-4.0.4/src/tload.c:84:34: call_function: calling ‘xrealloc’ from ‘setsize’
procps-ng-4.0.4/src/tload.c:84:34: return_function: returning to ‘setsize’ from ‘xrealloc’
procps-ng-4.0.4/src/tload.c:86:9: release_memory: using NULL here
procps-ng-4.0.4/src/tload.c:86:9: danger: argument 1 (‘screen’) NULL where non-null expected
#   84|   		screen = (char *)xrealloc(screen, scr_size);
#   85|   
#   86|-> 	memset(screen, ' ', scr_size - 1);
#   87|   	*(screen + scr_size - 2) = '\0';
#   88|   	if (i)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def159]
procps-ng-4.0.4/src/tload.c:86:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘screen’ where non-null expected
procps-ng-4.0.4/src/tload.c:63:13: enter_function: entry to ‘setsize’
procps-ng-4.0.4/src/tload.c:74:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/tload.c:76:13: branch_false: ...to here
procps-ng-4.0.4/src/tload.c:76:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/tload.c:81:12: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/tload.c:82:34: branch_true: ...to here
procps-ng-4.0.4/src/tload.c:82:34: call_function: calling ‘xmalloc’ from ‘setsize’
procps-ng-4.0.4/src/tload.c:82:34: return_function: returning to ‘setsize’ from ‘xmalloc’
procps-ng-4.0.4/src/tload.c:86:9: danger: argument 1 (‘screen’) from [(10)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/9) could be NULL where non-null expected
#   84|   		screen = (char *)xrealloc(screen, scr_size);
#   85|   
#   86|-> 	memset(screen, ' ', scr_size - 1);
#   87|   	*(screen + scr_size - 2) = '\0';
#   88|   	if (i)

Error: COMPILER_WARNING (CWE-704): [#def160]
procps-ng-4.0.4/src/top/top.c: scope_hint: In function ‘show_special’
procps-ng-4.0.4/src/top/top.c:1010:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1010 |    while ((lin_end = strchr(glob, '\n'))) {
#      |                    ^
# 1008|   
# 1009|      // handle multiple lines passed in a bunch
# 1010|->    while ((lin_end = strchr(glob, '\n'))) {
# 1011|       #define myMIN(a,b) (((a) < (b)) ? (a) : (b))
# 1012|         size_t lessor = myMIN((size_t)(lin_end - glob), sizeof(lin) -3);

Error: COMPILER_WARNING (CWE-704): [#def161]
procps-ng-4.0.4/src/top/top.c:1010:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1008|   
# 1009|      // handle multiple lines passed in a bunch
# 1010|->    while ((lin_end = strchr(glob, '\n'))) {
# 1011|       #define myMIN(a,b) (((a) < (b)) ? (a) : (b))
# 1012|         size_t lessor = myMIN((size_t)(lin_end - glob), sizeof(lin) -3);

Error: COMPILER_WARNING (CWE-704): [#def162]
procps-ng-4.0.4/src/top/top.c: scope_hint: In function ‘find_ofs’
procps-ng-4.0.4/src/top/top.c:5329:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5329 |    if (q->findstr[0] && (fnd = STRSTR(buf, q->findstr)))
#      |                              ^
# 5327|      char *fnd;
# 5328|   
# 5329|->    if (q->findstr[0] && (fnd = STRSTR(buf, q->findstr)))
# 5330|         return (int)(fnd - buf);
# 5331|      return -1;

Error: COMPILER_WARNING (CWE-704): [#def163]
procps-ng-4.0.4/src/top/top.c:5329:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5327|      char *fnd;
# 5328|   
# 5329|->    if (q->findstr[0] && (fnd = STRSTR(buf, q->findstr)))
# 5330|         return (int)(fnd - buf);
# 5331|      return -1;

Error: CPPCHECK_WARNING (CWE-476): [#def164]
procps-ng-4.0.4/src/w.c:267: warning[nullPointer]: Possible null pointer dereference: u
#  265|   		}
#  266|   	} else {  /* -i switch NOT used */
#  267|-> 		print_host(u->ut_host, UT_HOSTSIZE, fromlen);
#  268|   	}
#  269|   #else

Error: CPPCHECK_WARNING (CWE-476): [#def165]
procps-ng-4.0.4/src/w.c:548: warning[nullPointer]: Possible null pointer dereference: u
#  546|       for (i = 0; i < UT_LINESIZE; i++)
#  547|           /* clean up tty if garbled */
#  548|->         if (isalnum(u->ut_line[i]) || (u->ut_line[i] == '/'))
#  549|               tty[i + 5] = u->ut_line[i];
#  550|           else

Error: COMPILER_WARNING (CWE-563): [#def166]
procps-ng-4.0.4/src/w.c: scope_hint: In function ‘main’
procps-ng-4.0.4/src/w.c:811:21: warning[-Wunused-variable]: unused variable ‘i’
#  811 |                 int i;
#      |                     ^
#  809|   		char **sessions_list;
#  810|   		int sessions;
#  811|-> 		int i;
#  812|   
#  813|   		sessions = sd_get_sessions (&sessions_list);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def167]
procps-ng-4.0.4/src/watch.c:307:17: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
procps-ng-4.0.4/src/watch.c:561:12: enter_function: entry to ‘run_command’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_false: following ‘false’ branch (when ‘child != 0’)...
procps-ng-4.0.4/src/watch.c:612:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:613:18: acquire_memory: allocated here
procps-ng-4.0.4/src/watch.c:613:12: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
procps-ng-4.0.4/src/watch.c:616:9: call_function: inlined call to ‘reset_ansi’ from ‘run_command’
procps-ng-4.0.4/src/watch.c:617:30: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:619:21: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:620:25: call_function: calling ‘set_ansi_attribute’ from ‘run_command’
procps-ng-4.0.4/src/watch.c:620:25: return_function: returning to ‘run_command’ from ‘set_ansi_attribute’
procps-ng-4.0.4/src/watch.c:632:28: branch_false: following ‘false’ branch (when ‘tabwaspending == 0’)...
procps-ng-4.0.4/src/watch.c:636:28: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:636:28: branch_true: following ‘true’ branch (when ‘eolseen == 0’)...
procps-ng-4.0.4/src/watch.c:640:36: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:640:36: branch_true: following ‘true’ branch (when ‘tabpending == 0’)...
procps-ng-4.0.4/src/watch.c:640:36: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:643:52: branch_true: following ‘true’ branch (when ‘carry == 4294967295’)...
procps-ng-4.0.4/src/watch.c:644:61: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:644:61: call_function: calling ‘my_getwc’ from ‘run_command’
procps-ng-4.0.4/src/watch.c:644:61: return_function: returning to ‘run_command’ from ‘my_getwc’
procps-ng-4.0.4/src/watch.c:649:50: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:649:64: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:649:50: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:649:50: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:649:50: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:651:53: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:649:50: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:652:53: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:649:50: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:649:50: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:649:50: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:649:50: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:649:50: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:656:58: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:655:53: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:667:37: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:667:36: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:669:41: call_function: calling ‘process_ansi’ from ‘run_command’
#  305|   	}
#  306|   	if (c != '[') {
#  307|-> 		ungetc(c, fp);
#  308|   		return;
#  309|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def168]
procps-ng-4.0.4/src/watch.c:456:33: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
procps-ng-4.0.4/src/watch.c:561:12: enter_function: entry to ‘run_command’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_false: following ‘false’ branch (when ‘child != 0’)...
procps-ng-4.0.4/src/watch.c:612:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:613:18: acquire_memory: allocated here
procps-ng-4.0.4/src/watch.c:613:12: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
procps-ng-4.0.4/src/watch.c:616:9: call_function: inlined call to ‘reset_ansi’ from ‘run_command’
procps-ng-4.0.4/src/watch.c:617:30: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:619:21: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:624:29: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:626:32: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:632:28: branch_false: following ‘false’ branch (when ‘tabwaspending == 0’)...
procps-ng-4.0.4/src/watch.c:636:28: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:636:28: branch_true: following ‘true’ branch (when ‘eolseen == 0’)...
procps-ng-4.0.4/src/watch.c:640:36: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:640:36: branch_true: following ‘true’ branch (when ‘tabpending == 0’)...
procps-ng-4.0.4/src/watch.c:640:36: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:643:52: branch_true: following ‘true’ branch (when ‘carry == 4294967295’)...
procps-ng-4.0.4/src/watch.c:644:61: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:644:61: call_function: calling ‘my_getwc’ from ‘run_command’
#  454|   			while (byte > 1) {
#  455|   				/* at least *try* to fix up */
#  456|-> 				ungetc(i[--byte], s);
#  457|   			}
#  458|   			errno = -EILSEQ;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def169]
procps-ng-4.0.4/src/watch.c:578:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:578:9: throw: if ‘fflush’ throws an exception...
procps-ng-4.0.4/src/watch.c:578:9: danger: ‘pipefd[0]’ leaks here
#  576|   
#  577|   	/* flush stdout and stderr, since we're about to do fd stuff */
#  578|-> 	fflush(stdout);
#  579|   	fflush(stderr);
#  580|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def170]
procps-ng-4.0.4/src/watch.c:578:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:578:9: throw: if ‘fflush’ throws an exception...
procps-ng-4.0.4/src/watch.c:578:9: danger: ‘pipefd[1]’ leaks here
#  576|   
#  577|   	/* flush stdout and stderr, since we're about to do fd stuff */
#  578|-> 	fflush(stdout);
#  579|   	fflush(stderr);
#  580|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def171]
procps-ng-4.0.4/src/watch.c:579:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:579:9: throw: if ‘fflush’ throws an exception...
procps-ng-4.0.4/src/watch.c:579:9: danger: ‘pipefd[0]’ leaks here
#  577|   	/* flush stdout and stderr, since we're about to do fd stuff */
#  578|   	fflush(stdout);
#  579|-> 	fflush(stderr);
#  580|   
#  581|   	/* fork to prepare to run command */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def172]
procps-ng-4.0.4/src/watch.c:579:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:579:9: throw: if ‘fflush’ throws an exception...
procps-ng-4.0.4/src/watch.c:579:9: danger: ‘pipefd[1]’ leaks here
#  577|   	/* flush stdout and stderr, since we're about to do fd stuff */
#  578|   	fflush(stdout);
#  579|-> 	fflush(stderr);
#  580|   
#  581|   	/* fork to prepare to run command */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def173]
procps-ng-4.0.4/src/watch.c:587:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_true: following ‘true’ branch (when ‘child == 0’)...
procps-ng-4.0.4/src/watch.c:587:17: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:587:17: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/watch.c:587:17: danger: ‘pipefd[0]’ leaks here
#  585|   		xerr(2, _("unable to fork process"));
#  586|   	} else if (child == 0) {	/* in child */
#  587|-> 		close(pipefd[0]);		/* child doesn't need read side of pipe */
#  588|   		close(1);			/* prepare to replace stdout with pipe */
#  589|   		if (dup2(pipefd[1], 1) < 0) {	/* replace stdout with write side of pipe */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def174]
procps-ng-4.0.4/src/watch.c:587:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_true: following ‘true’ branch (when ‘child == 0’)...
procps-ng-4.0.4/src/watch.c:587:17: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:587:17: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/watch.c:587:17: danger: ‘pipefd[1]’ leaks here
#  585|   		xerr(2, _("unable to fork process"));
#  586|   	} else if (child == 0) {	/* in child */
#  587|-> 		close(pipefd[0]);		/* child doesn't need read side of pipe */
#  588|   		close(1);			/* prepare to replace stdout with pipe */
#  589|   		if (dup2(pipefd[1], 1) < 0) {	/* replace stdout with write side of pipe */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def175]
procps-ng-4.0.4/src/watch.c:588:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_true: following ‘true’ branch (when ‘child == 0’)...
procps-ng-4.0.4/src/watch.c:587:17: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:588:17: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/watch.c:588:17: danger: ‘pipefd[1]’ leaks here
#  586|   	} else if (child == 0) {	/* in child */
#  587|   		close(pipefd[0]);		/* child doesn't need read side of pipe */
#  588|-> 		close(1);			/* prepare to replace stdout with pipe */
#  589|   		if (dup2(pipefd[1], 1) < 0) {	/* replace stdout with write side of pipe */
#  590|   			xerr(3, _("dup2 failed"));

Error: GCC_ANALYZER_WARNING: [#def176]
procps-ng-4.0.4/src/watch.c:589:21: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_true: following ‘true’ branch (when ‘child == 0’)...
procps-ng-4.0.4/src/watch.c:587:17: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:588:17: release_resource: closed here
procps-ng-4.0.4/src/watch.c:589:21: danger: ‘1’ could be invalid
#  587|   		close(pipefd[0]);		/* child doesn't need read side of pipe */
#  588|   		close(1);			/* prepare to replace stdout with pipe */
#  589|-> 		if (dup2(pipefd[1], 1) < 0) {	/* replace stdout with write side of pipe */
#  590|   			xerr(3, _("dup2 failed"));
#  591|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def177]
procps-ng-4.0.4/src/watch.c:592:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_true: following ‘true’ branch (when ‘child == 0’)...
procps-ng-4.0.4/src/watch.c:587:17: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:589:20: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:592:17: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:592:17: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/watch.c:592:17: danger: ‘pipefd[1]’ leaks here
#  590|   			xerr(3, _("dup2 failed"));
#  591|   		}
#  592|-> 		close(pipefd[1]);		/* once duped, the write fd isn't needed */
#  593|   		dup2(1, 2);			/* stderr should default to stdout */
#  594|   

Error: GCC_ANALYZER_WARNING (CWE-910): [#def178]
procps-ng-4.0.4/src/watch.c:593:17: warning[-Wanalyzer-fd-use-after-close]: ‘dup2’ on closed file descriptor ‘1’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_true: following ‘true’ branch (when ‘child == 0’)...
procps-ng-4.0.4/src/watch.c:587:17: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:588:17: release_resource: closed here
procps-ng-4.0.4/src/watch.c:589:20: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:592:17: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:593:17: danger: ‘dup2’ on closed file descriptor ‘1’; ‘close’ was at [(8)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/7)
#  591|   		}
#  592|   		close(pipefd[1]);		/* once duped, the write fd isn't needed */
#  593|-> 		dup2(1, 2);			/* stderr should default to stdout */
#  594|   
#  595|   		if (flags & WATCH_EXEC) {	/* pass command to exec instead of system */

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def179]
procps-ng-4.0.4/src/watch.c:612:9: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘pipefd[1]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_true: following ‘true’ branch (when ‘child == 0’)...
procps-ng-4.0.4/src/watch.c:587:17: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:589:20: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:592:17: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:592:17: release_resource: first ‘close’ here
procps-ng-4.0.4/src/watch.c:595:20: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:596:29: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:596:28: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:612:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:612:9: danger: second ‘close’ here; first ‘close’ was at [(11)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/10)
#  610|   
#  611|   	/* otherwise, we're in parent */
#  612|-> 	close(pipefd[1]);	/* close write side of pipe */
#  613|   	if ((p = fdopen(pipefd[0], "r")) == NULL)
#  614|   		xerr(5, _("fdopen"));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def180]
procps-ng-4.0.4/src/watch.c:612:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_false: following ‘false’ branch (when ‘child != 0’)...
procps-ng-4.0.4/src/watch.c:612:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:612:9: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/watch.c:612:9: danger: ‘pipefd[0]’ leaks here
#  610|   
#  611|   	/* otherwise, we're in parent */
#  612|-> 	close(pipefd[1]);	/* close write side of pipe */
#  613|   	if ((p = fdopen(pipefd[0], "r")) == NULL)
#  614|   		xerr(5, _("fdopen"));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def181]
procps-ng-4.0.4/src/watch.c:612:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
procps-ng-4.0.4/src/watch.c:574:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:578:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:584:12: branch_false: following ‘false’ branch (when ‘child >= 0’)...
procps-ng-4.0.4/src/watch.c:586:19: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:586:19: branch_false: following ‘false’ branch (when ‘child != 0’)...
procps-ng-4.0.4/src/watch.c:612:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:612:9: throw: if ‘close’ throws an exception...
procps-ng-4.0.4/src/watch.c:612:9: danger: ‘pipefd[1]’ leaks here
#  610|   
#  611|   	/* otherwise, we're in parent */
#  612|-> 	close(pipefd[1]);	/* close write side of pipe */
#  613|   	if ((p = fdopen(pipefd[0], "r")) == NULL)
#  614|   		xerr(5, _("fdopen"));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def182]
procps-ng-4.0.4/src/watch.c:935:26: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
procps-ng-4.0.4/src/watch.c:812:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/watch.c:928:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:932:30: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:934:19: call_function: calling ‘xstrdup’ from ‘main’
procps-ng-4.0.4/src/watch.c:934:19: return_function: returning to ‘main’ from ‘xstrdup’
procps-ng-4.0.4/src/watch.c:935:26: danger: argument 1 (‘xstrdup(*command_argv)’) NULL where non-null expected
#  933|   
#  934|   	command = xstrdup(argv[optind++]);
#  935|-> 	command_length = strlen(command);
#  936|   	for (; optind < argc; optind++) {
#  937|   		char *endp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
procps-ng-4.0.4/src/watch.c:936:31: warning[-Wanalyzer-malloc-leak]: leak of ‘command’
procps-ng-4.0.4/src/watch.c:812:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/watch.c:928:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:932:30: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:934:19: call_function: calling ‘xstrdup’ from ‘main’
procps-ng-4.0.4/src/watch.c:934:19: return_function: returning to ‘main’ from ‘xstrdup’
procps-ng-4.0.4/src/watch.c:936:16: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:938:36: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:940:27: call_function: calling ‘xrealloc’ from ‘main’
procps-ng-4.0.4/src/watch.c:940:27: return_function: returning to ‘main’ from ‘xrealloc’
procps-ng-4.0.4/src/watch.c:936:31: danger: ‘command’ leaks here; was allocated at [(8)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/7)
#  934|   	command = xstrdup(argv[optind++]);
#  935|   	command_length = strlen(command);
#  936|-> 	for (; optind < argc; optind++) {
#  937|   		char *endp;
#  938|   		int s = strlen(argv[optind]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def184]
procps-ng-4.0.4/src/watch.c:977:9: warning[-Wanalyzer-malloc-leak]: leak of ‘command’
procps-ng-4.0.4/src/watch.c:812:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/watch.c:928:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:932:30: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:934:19: call_function: calling ‘xstrdup’ from ‘main’
procps-ng-4.0.4/src/watch.c:934:19: return_function: returning to ‘main’ from ‘xstrdup’
procps-ng-4.0.4/src/watch.c:936:16: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:938:36: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:940:27: call_function: calling ‘xrealloc’ from ‘main’
procps-ng-4.0.4/src/watch.c:940:27: return_function: returning to ‘main’ from ‘xrealloc’
procps-ng-4.0.4/src/watch.c:936:16: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:952:31: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:953:12: branch_false: following ‘false’ branch (when ‘wcommand_characters >= 0’)...
procps-ng-4.0.4/src/watch.c:958:32: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:959:12: branch_false: following ‘false’ branch (when ‘wcommand’ is non-NULL)...
procps-ng-4.0.4/src/watch.c:963:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:966:9: call_function: calling ‘get_terminal_size’ from ‘main’
procps-ng-4.0.4/src/watch.c:966:9: return_function: returning to ‘main’ from ‘get_terminal_size’
procps-ng-4.0.4/src/watch.c:977:9: throw: if ‘initscr’ throws an exception...
procps-ng-4.0.4/src/watch.c:977:9: danger: ‘command’ leaks here; was allocated at [(15)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/14)
#  975|   	/* Set up tty for curses use.  */
#  976|   	curses_started = 1;
#  977|-> 	initscr();
#  978|   	if (flags & WATCH_COLOR) {
#  979|   		if (has_colors()) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def185]
procps-ng-4.0.4/src/watch.c:987:9: warning[-Wanalyzer-malloc-leak]: leak of ‘command’
procps-ng-4.0.4/src/watch.c:812:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/watch.c:928:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:932:30: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:934:19: call_function: calling ‘xstrdup’ from ‘main’
procps-ng-4.0.4/src/watch.c:934:19: return_function: returning to ‘main’ from ‘xstrdup’
procps-ng-4.0.4/src/watch.c:936:16: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:938:36: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:940:27: call_function: calling ‘xrealloc’ from ‘main’
procps-ng-4.0.4/src/watch.c:940:27: return_function: returning to ‘main’ from ‘xrealloc’
procps-ng-4.0.4/src/watch.c:936:16: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:952:31: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:953:12: branch_false: following ‘false’ branch (when ‘wcommand_characters >= 0’)...
procps-ng-4.0.4/src/watch.c:958:32: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:959:12: branch_false: following ‘false’ branch (when ‘wcommand’ is non-NULL)...
procps-ng-4.0.4/src/watch.c:963:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:966:9: call_function: calling ‘get_terminal_size’ from ‘main’
procps-ng-4.0.4/src/watch.c:966:9: return_function: returning to ‘main’ from ‘get_terminal_size’
procps-ng-4.0.4/src/watch.c:978:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:987:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:987:9: throw: if ‘nonl’ throws an exception...
procps-ng-4.0.4/src/watch.c:987:9: danger: ‘command’ leaks here; was allocated at [(15)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/14)
#  985|   		}
#  986|   	}
#  987|-> 	nonl();
#  988|   	noecho();
#  989|   	cbreak();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def186]
procps-ng-4.0.4/src/watch.c:988:9: warning[-Wanalyzer-malloc-leak]: leak of ‘command’
procps-ng-4.0.4/src/watch.c:812:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/watch.c:928:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:932:30: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:934:19: call_function: calling ‘xstrdup’ from ‘main’
procps-ng-4.0.4/src/watch.c:934:19: return_function: returning to ‘main’ from ‘xstrdup’
procps-ng-4.0.4/src/watch.c:936:16: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:938:36: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:940:27: call_function: calling ‘xrealloc’ from ‘main’
procps-ng-4.0.4/src/watch.c:940:27: return_function: returning to ‘main’ from ‘xrealloc’
procps-ng-4.0.4/src/watch.c:936:16: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:952:31: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:953:12: branch_false: following ‘false’ branch (when ‘wcommand_characters >= 0’)...
procps-ng-4.0.4/src/watch.c:958:32: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:959:12: branch_false: following ‘false’ branch (when ‘wcommand’ is non-NULL)...
procps-ng-4.0.4/src/watch.c:963:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:966:9: call_function: calling ‘get_terminal_size’ from ‘main’
procps-ng-4.0.4/src/watch.c:966:9: return_function: returning to ‘main’ from ‘get_terminal_size’
procps-ng-4.0.4/src/watch.c:988:9: throw: if ‘noecho’ throws an exception...
procps-ng-4.0.4/src/watch.c:988:9: danger: ‘command’ leaks here; was allocated at [(15)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/14)
#  986|   	}
#  987|   	nonl();
#  988|-> 	noecho();
#  989|   	cbreak();
#  990|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def187]
procps-ng-4.0.4/src/watch.c:989:9: warning[-Wanalyzer-malloc-leak]: leak of ‘command’
procps-ng-4.0.4/src/watch.c:812:5: enter_function: entry to ‘main’
procps-ng-4.0.4/src/watch.c:928:12: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:932:30: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:934:19: call_function: calling ‘xstrdup’ from ‘main’
procps-ng-4.0.4/src/watch.c:934:19: return_function: returning to ‘main’ from ‘xstrdup’
procps-ng-4.0.4/src/watch.c:936:16: branch_true: following ‘true’ branch...
procps-ng-4.0.4/src/watch.c:938:36: branch_true: ...to here
procps-ng-4.0.4/src/watch.c:940:27: call_function: calling ‘xrealloc’ from ‘main’
procps-ng-4.0.4/src/watch.c:940:27: return_function: returning to ‘main’ from ‘xrealloc’
procps-ng-4.0.4/src/watch.c:936:16: branch_false: following ‘false’ branch...
procps-ng-4.0.4/src/watch.c:952:31: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:953:12: branch_false: following ‘false’ branch (when ‘wcommand_characters >= 0’)...
procps-ng-4.0.4/src/watch.c:958:32: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:959:12: branch_false: following ‘false’ branch (when ‘wcommand’ is non-NULL)...
procps-ng-4.0.4/src/watch.c:963:9: branch_false: ...to here
procps-ng-4.0.4/src/watch.c:966:9: call_function: calling ‘get_terminal_size’ from ‘main’
procps-ng-4.0.4/src/watch.c:966:9: return_function: returning to ‘main’ from ‘get_terminal_size’
procps-ng-4.0.4/src/watch.c:989:9: throw: if ‘cbreak’ throws an exception...
procps-ng-4.0.4/src/watch.c:989:9: danger: ‘command’ leaks here; was allocated at [(15)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/14)
#  987|   	nonl();
#  988|   	noecho();
#  989|-> 	cbreak();
#  990|   
#  991|   	if (precise_timekeeping)

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-99.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-nameprocps-ng-4.0.4-9.fc44
store-results-to/tmp/tmpjyqrkk_u/procps-ng-4.0.4-9.fc44.tar.xz
time-created2026-01-08 20:27:12
time-finished2026-01-08 20:29:27
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpjyqrkk_u/procps-ng-4.0.4-9.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpjyqrkk_u/procps-ng-4.0.4-9.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9