Date: Sat, 01 Feb 2014 23:11:20 +0400 From: Boris Samorodov <bsam@passap.ru> To: FreeBSD CURRENT <freebsd-current@freebsd.org> Subject: [patch: libc/rpc/svc_vc.c] clang analyser: Branch condition evaluates to a garbage value Message-ID: <52ED46D8.9050001@passap.ru>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------040004010101000405080101 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi All, While using clang static analyzer at CURRENT (r261322) I got: http://gw.wart.ru/2014-02-01-200848-39517-1/report-01bc48.html There is no need at line 143 to "goto cleanup_svc_vc_create" (neither xprt nor r are allocated so far). Just "return NULL" should be fine. BTW, NetBSD do the latter as well. So I propose a tiny patch (attached). -- WBR, Boris Samorodov (bsam) FreeBSD Committer, http://www.FreeBSD.org The Power To Serve --------------040004010101000405080101 Content-Type: text/plain; charset=UTF-8; name="libc-rpc-svc_vc.c.diff.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="libc-rpc-svc_vc.c.diff.txt" SW5kZXg6IC91c3Ivc3JjL2xpYi9saWJjL3JwYy9zdmNfdmMuYwo9PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0t LSAvdXNyL3NyYy9saWIvbGliYy9ycGMvc3ZjX3ZjLmMJKHJldmlzaW9uIDI2MDAzNikKKysr IC91c3Ivc3JjL2xpYi9saWJjL3JwYy9zdmNfdmMuYwkod29ya2luZyBjb3B5KQpAQCAtMTQx LDcgKzE0MSw3IEBACiAJciA9IG1lbV9hbGxvYyhzaXplb2YoKnIpKTsKIAlpZiAociA9PSBO VUxMKSB7CiAJCXdhcm54KCJzdmNfdmNfY3JlYXRlOiBvdXQgb2YgbWVtb3J5Iik7Ci0JCWdv dG8gY2xlYW51cF9zdmNfdmNfY3JlYXRlOworCQlyZXR1cm4gTlVMTDsKIAl9CiAJci0+c2Vu ZHNpemUgPSBfX3JwY19nZXRfdF9zaXplKHNpLnNpX2FmLCBzaS5zaV9wcm90bywgKGludClz ZW5kc2l6ZSk7CiAJci0+cmVjdnNpemUgPSBfX3JwY19nZXRfdF9zaXplKHNpLnNpX2FmLCBz aS5zaV9wcm90bywgKGludClyZWN2c2l6ZSk7Cg== --------------040004010101000405080101--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52ED46D8.9050001>