Re: [OpenSIPS-Devel] [opensips] F_MALLOC: suppress warnings for free(NULL) (17d639b)
the libc free() (man 3 free) allows free'ing NULL pointers. I think the quality of the codebase is improved if we stick to this standard. Your suggestion is excellent. We definitely have to remove all `if (buf)` tests! --- Reply to this email directly or view it on GitHub: https://github.com/OpenSIPS/opensips/commit/17d639b9f11b415d51062005aadb86dd6c2375e2#commitcomment-11680487___ Devel mailing list Devel@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
Re: [OpenSIPS-Devel] [opensips] F_MALLOC: suppress warnings for free(NULL) (17d639b)
Shouldn't you fix the caller that pkg_free's without checking for NULL instead? If you allow it, then you might as well drop all the `if(buf)` before every `pkg_free(buf)`. Allowing both makes the code inconsistent. Right? --- Reply to this email directly or view it on GitHub: https://github.com/OpenSIPS/opensips/commit/17d639b9f11b415d51062005aadb86dd6c2375e2#commitcomment-11680174___ Devel mailing list Devel@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/devel