From: Craig Small Date: Tue, 2 Nov 2021 06:14:29 +0000 (+1100) Subject: pmap: minor Coverity fix for -N option X-Git-Tag: v4.0.0~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3e52900128c0d536a747433fd4120b5f1de1e7d;p=procps-ng pmap: minor Coverity fix for -N option 99126 Explicit null dereferenced Not 100% sure this is valid (the same branch that sets the variable is the one that sets N_option) but not too hard to fix. Signed-off-by: Craig Small --- diff --git a/pmap.c b/pmap.c index 042d9dc0..38b3629f 100644 --- a/pmap.c +++ b/pmap.c @@ -909,10 +909,13 @@ static int config_read (char *rc_filename) } -static int config_create (char *rc_filename) +static int config_create (const char *rc_filename) { FILE *f; + if (rc_filename == NULL) + return 0; + /* check if rc exists */ f = fopen(rc_filename, "r");