[Asterisk-code-review] app voicemail: Avoid always true when using pointer address. (asterisk[15])

Alexander Traud asteriskteam at digium.com
Mon Jan 29 10:01:55 CST 2018


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/8087


Change subject: app_voicemail: Avoid always true when using pointer address.
......................................................................

app_voicemail: Avoid always true when using pointer address.

clang 4.0 warned about this.

ASTERISK-27635

Change-Id: I213f230607d7fbe97c0f5f2d60da9cbf5a2d8231
---
M apps/app_voicemail.c
1 file changed, 2 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/87/8087/1

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 35cfff9..d22a839 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -3480,7 +3480,7 @@
 	if (interactive) {
 		struct vm_state *vms;
 		pthread_once(&ts_vmstate.once, ts_vmstate.key_init);
-		if ((vms = pthread_getspecific(ts_vmstate.key)) && vms->imapuser && !strcmp(vms->imapuser, user)) {
+		if ((vms = pthread_getspecific(ts_vmstate.key)) && !strcmp(vms->imapuser, user)) {
 			return vms;
 		}
 	}
@@ -3492,10 +3492,6 @@
 			continue;
 		}
 		if (vlist->vms->imapversion != imapversion) {
-			continue;
-		}
-		if (!vlist->vms->imapuser) {
-			ast_debug(3, "error: imapuser is NULL for %s\n", user);
 			continue;
 		}
 
@@ -3520,7 +3516,7 @@
 	if (interactive) {
 		struct vm_state *vms;
 		pthread_once(&ts_vmstate.once, ts_vmstate.key_init);
-		if ((vms = pthread_getspecific(ts_vmstate.key)) && vms->username && vms->context &&
+		if ((vms = pthread_getspecific(ts_vmstate.key)) &&
 		    !strcmp(vms->username,mailbox) && !strcmp(vms->context, local_context)) {
 			return vms;
 		}
@@ -3533,10 +3529,6 @@
 			continue;
 		}
 		if (vlist->vms->imapversion != imapversion) {
-			continue;
-		}
-		if (!vlist->vms->username || !vlist->vms->context) {
-			ast_debug(3, "error: username is NULL for %s\n", mailbox);
 			continue;
 		}
 

-- 
To view, visit https://gerrit.asterisk.org/8087
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I213f230607d7fbe97c0f5f2d60da9cbf5a2d8231
Gerrit-Change-Number: 8087
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180129/e35613e8/attachment.html>


More information about the asterisk-code-review mailing list