From 0177d7b23d5bece49023dca12d603bf1866022f0 Mon Sep 17 00:00:00 2001
From: Anthony Minessale <anthm@freeswitch.org>
Date: Mon, 7 Jan 2013 10:13:58 -0600
Subject: [PATCH] FS-4998 --resolve

---
 src/mod/endpoints/mod_sofia/sofia_reg.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c
index c0b81d3573..07270b8cac 100644
--- a/src/mod/endpoints/mod_sofia/sofia_reg.c
+++ b/src/mod/endpoints/mod_sofia/sofia_reg.c
@@ -526,7 +526,11 @@ int sofia_reg_find_reg_with_positive_expires_callback(void *pArg, int argc, char
 	long int expires;
 	char *contact = NULL;
 
-	if (argv[0] && cbt->contact_str && !strcasecmp(argv[0], cbt->contact_str)) {
+	if (zstr(argv[0])) {
+		return 0;
+	}
+
+	if (cbt->contact_str && !strcasecmp(argv[0], cbt->contact_str)) {
 		expires = cbt->exptime;
 	} else {
 		expires = atol(argv[1]) - 60 - (long) cbt->time;