diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index 3bced1180ca438623a9ed4fb0e826e96fb2736b7..23aa522ce89f1c17d7a4a85296f2c195ebea4d39 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -963,7 +963,9 @@ static int dtls_handler(const struct aco_option *opt,
 {
 	struct ast_sip_endpoint *endpoint = obj;
 	char *name = ast_strdupa(var->name);
-	char *front, *back, *buf = name;
+	char *front = NULL;
+	char *back = NULL;
+	char *buf = name;
 
 	/* strip out underscores in the name */
 	front = strtok_r(buf, "_", &back);