<p>Looking at the addition of the close(fd), that is fine but when main() exits, the file descriptors will effectively be closed. Stylistically, its best to close them when you are done. Up to Michal if he wants to fix that part.</p>

<div class="gmail_quote">On Feb 5, 2013 2:45 PM, "Brian Wilkins" <<a href="mailto:bwilkins@gmail.com">bwilkins@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>Of course if we did dereference it, the program would likely segfault. </p>
<p>I have not had a chance to look at the other issues, but I will soon.</p>
<div class="gmail_quote">On Feb 5, 2013 2:31 PM, "Arthur Mesh" <<a href="mailto:arthurmesh@gmail.com" target="_blank">arthurmesh@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On Tue, Feb 05, 2013 at 01:52:12PM -0500, Brian Wilkins wrote:<br>
> You are completely correct in that regard, but checking if a pointer is<br>
> null is a different concept. It's not as if the program tried to see if it<br>
> actually contained a string.<br>
<br>
I am not sure why you are bringing up the concept of empty string here.<br>
I don't think it's relevant at all. Yes, errstr points to a string, but we<br>
don't dereference it check first char is not \0.<br>
<br>
In any case, looking further in to this defect, I believe it's false<br>
positive. The following bit from coverity is bogus:<br>
<br>
At (20): Condition "new_service_options.next", taking true branch<br>
2096 � �if(new_service_options.next) { /* daemon mode: initialize sections */<br>
At (21): Condition "section", taking false branch<br>
2097 � � � �for(section=new_service_options.next; section; section=section->next) {<br>
2098 � � � � � �s_log(LOG_INFO, "Initializing service [%s]", section->servname);<br>
2099 � � � � � �errstr=parse_service_option(CMD_END, section, NULL, NULL);<br>
2100 � � � � � �if(errstr)<br>
2101 � � � � � � � �break;<br>
2102 � � � �}<br>
At (22): Falling through to end of if statement<br>
2103 � �}<br>
<br>
Note that "At (21): Condition "section", taking false branch" can never<br>
be true, since section is guaranteed to be non-NULL (due to<br>
section==new_service_options.next, whereas new_service_options.next !=<br>
NULL).<br>
<br>
Thoughts?<br>
<br>
What about the other two UNINIT defects? �I assume memory leak defects<br>
are pretty obvious.<br>
<br>
Thanks<br>
</blockquote></div>
</blockquote></div>