From 7cccaf93b2d2729c7ed9ed263e49ffa50ecf8553 Mon Sep 17 00:00:00 2001
From: Russell Bryant <russell@russellbryant.com>
Date: Sat, 7 May 2011 23:36:41 +0000
Subject: [PATCH] Merged revisions 318057 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r318057 | russell | 2011-05-07 18:35:37 -0500 (Sat, 07 May 2011) | 8 lines

  res_config_curl: fix a crash with static realtime.

  (closes issue #18413)
  Reported by: jmls
  Patches:
        20101202__issue18413.diff.txt uploaded by tilghman (license 14)
  Tested by: jmls
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 res/res_config_curl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/res/res_config_curl.c b/res/res_config_curl.c
index f80998e365..8488d9bdc1 100644
--- a/res/res_config_curl.c
+++ b/res/res_config_curl.c
@@ -575,7 +575,7 @@ static struct ast_config *config_curl(const char *url, const char *unused, const
 				return NULL;
 		}
 
-		if (strcmp(category, cur_cat) || last_cat_metric != cat_metric) {
+		if (!cat || strcmp(category, cur_cat) || last_cat_metric != cat_metric) {
 			if (!(cat = ast_category_new(category, "", 99999)))
 				break;
 			cur_cat = category;
-- 
GitLab