After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733711 - Remove couple of dead conditions.
Remove couple of dead conditions.
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal critical
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2014-07-25 05:28 UTC by Gaurav
Modified: 2014-07-26 20:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove couple of dead conditions. (651 bytes, patch)
2014-07-25 05:28 UTC, Gaurav
none Details | Review

Description Gaurav 2014-07-25 05:28:00 UTC
Created attachment 281656 [details] [review]
Remove couple of dead conditions.

"xmlIO.c"

if (filename == NULL)
        return(NULL);

Above conditions already checks if filename is NULL. No need to do Null check again for path.
as path=filename;

"xmlmemory.c"
p = (MEMHDR *) malloc(RESERVE_SIZE+size);
    if (!p) {
      goto error;
    }
It already checks if P is NULL.

s = (char *) HDR_2_CLIENT(p);
It assigns some memory of p, so cannot be Null.
so, checking s to NUll is not required.

Please apply attached patch.
Comment 1 Daniel Veillard 2014-07-26 20:42:43 UTC
For the first one I preferred to change the coding slightly to
avoid the risk of generating a NULL pointer if more cases were added there.
Second patch fine :-)

   Applied and fixed in git,

     thanks !

Daniel