[asterisk-commits] kmoore: trunk r397461 - /trunk/main/cel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 22 14:53:01 CDT 2013


Author: kmoore
Date: Thu Aug 22 14:52:59 2013
New Revision: 397461

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397461
Log:
Fix crash when getting CEL config

Modified:
    trunk/main/cel.c

Modified: trunk/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/cel.c?view=diff&rev=397461&r1=397460&r2=397461
==============================================================================
--- trunk/main/cel.c (original)
+++ trunk/main/cel.c Thu Aug 22 14:52:59 2013
@@ -1512,7 +1512,7 @@
 {
 	RAII_VAR(struct cel_config *, mod_cfg, ao2_global_obj_ref(cel_configs), ao2_cleanup);
 
-	if (!mod_cfg->general) {
+	if (!mod_cfg || !mod_cfg->general) {
 		return NULL;
 	}
 
@@ -1525,9 +1525,11 @@
 	RAII_VAR(struct cel_config *, mod_cfg, ao2_global_obj_ref(cel_configs), ao2_cleanup);
 	RAII_VAR(struct ast_cel_general_config *, cleanup_config, mod_cfg->general, ao2_cleanup);
 
-	mod_cfg->general = config;
-	if (mod_cfg->general) {
-		ao2_ref(mod_cfg->general, +1);
+	if (mod_cfg) {
+		mod_cfg->general = config;
+		if (mod_cfg->general) {
+			ao2_ref(mod_cfg->general, +1);
+		}
 	}
 }
 




More information about the asterisk-commits mailing list