diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 9159118410973113231e3eab7f6bc4fa066dfc51..bcbcfa344cd7c7f355fffb3c46b3a6652c534e41 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -18577,12 +18577,6 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
 			ast_log(LOG_WARNING, "Ignoring any changes to '%s' (on reload) at line %d.\n", v->name, v->lineno);
 	}
 
-	/* Since confp has already filled invidual dahdi_pvt objects with channels at this point, clear the variables in confp's pvt. */
-	if (confp->chan.vars) {
-		ast_variables_destroy(confp->chan.vars);
-		confp->chan.vars = NULL;
-	}
-
 	if (dahdichan) {
 		/* Process the deferred dahdichan value. */
 		if (build_channels(confp, dahdichan->value, reload, dahdichan->lineno,
@@ -18597,6 +18591,15 @@ static int process_dahdi(struct dahdi_chan_conf *confp, const char *cat, struct
 		}
 	}
 
+	/*
+	 * Since confp has already filled individual dahdi_pvt objects with channels
+	 * at this point, clear the variables in confp's pvt.
+	 */
+	if (confp->chan.vars) {
+		ast_variables_destroy(confp->chan.vars);
+		confp->chan.vars = NULL;
+	}
+
 	/* mark the first channels of each DAHDI span to watch for their span alarms */
 	for (tmp = iflist, y=-1; tmp; tmp = tmp->next) {
 		if (!tmp->destroy && tmp->span != y) {