sigmasternchen / Serwer

Standalone Webserver
MIT License
0 stars 0 forks source link

Setting pointer to NULL after if #3

Closed BloodyWulf closed 7 years ago

BloodyWulf commented 7 years ago

Hey there.

In the File webserver.c, line 735 to 737 you have this piece of code:

if (host != NULL)
    free(host);
host = NULL;

Looks like setting the pointer to NULL should be within the if. It is not bad outside of the if but unnecessary, because the pointer is allready NULL if you do not enter the if. I think the code should be like this:

if (host != NULL) {
    free(host);
    host = NULL;
}

Regards

sigmasternchen commented 7 years ago

Makes sense. I'm going to fix that soon.