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

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


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


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/86/8086/1

diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 891b6f0..db6b757 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -3482,7 +3482,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;
 		}
 	}
@@ -3494,10 +3494,6 @@
 			continue;
 		}
 		if (vlist->vms->imapversion != imapversion) {
-			continue;
-		}
-		if (!vlist->vms->imapuser) {
-			ast_debug(3, "error: imapuser is NULL for %s\n", user);
 			continue;
 		}
 
@@ -3522,7 +3518,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;
 		}
@@ -3535,10 +3531,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/8086
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I213f230607d7fbe97c0f5f2d60da9cbf5a2d8231
Gerrit-Change-Number: 8086
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/2e245130/attachment-0001.html>


More information about the asterisk-code-review mailing list