diff --git a/apps/app_directory.c b/apps/app_directory.c
index ad785c8c5ded8fa01d089a0bf1dab994a2bf0f14..34f76f2f86e5c3870f15431c2d5f2c80dfd0279c 100755
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -250,7 +250,7 @@ static int directory_exec(struct ast_channel *chan, void *data)
 	}
 	LOCAL_USER_ADD(u);
 top:
-	context = strdupa(data);
+	context = ast_strdupa(data);
 	dialcontext = strchr(context, '|');
 	if (dialcontext) {
 		*dialcontext = '\0';