You are completely correct in that regard, but checking if a pointer is null is a different concept. It's not as if the program tried to see if it actually contained a string.
On Tue, Feb 05, 2013 at 01:41:30PM -0500, Brian Wilkins wrote:
> It's a variable that points to null.
Only if you initialize it. It's not initialized during declaration, hence its
value is "garbage" from stack. It's only initialized conditionally later on.
> this is a valid check to see if the
> pointer is null. Coverity is showing a false positive.
I don't see any evidence showing that it's guaranteed to be initialized
before you read its value in:
2113 if(errstr) {
2114 s_log(LOG_ERR, "Service [%s]: %s", section->servname,
2115 errstr);
2116 return 1;
2117 }
In any case. if you're convinced it's a false positive, so be it.