platform: msm_shared: Fixed the memory leak of str_target

The str_align_right be called twice, but it only be freed once.
So free the str_target after current call finished, so that it
could not impact next call

CRs-Fixed: 996655
Change-Id: I6e4b8e777e15932e89b6931efbcdceeb5e715405
diff --git a/platform/msm_shared/display_menu.c b/platform/msm_shared/display_menu.c
index fb4e0a8..cea4937 100644
--- a/platform/msm_shared/display_menu.c
+++ b/platform/msm_shared/display_menu.c
@@ -257,12 +257,16 @@
 
 	/* Align Right */
 	str_target = str_align_right(str1, big_factor);
-	if(str_target != NULL)
+	if(str_target != NULL) {
 		display_fbcon_menu_message(str_target, FBCON_TITLE_MSG, big_factor);
+		free(str_target);
+	}
 
 	str_target = str_align_right(str2, common_factor);
-	if(str_target != NULL)
+	if(str_target != NULL) {
 		display_fbcon_menu_message(str_target, FBCON_TITLE_MSG, common_factor);
+		free(str_target);
+	}
 
 	display_fbcon_menu_message("\n< More options\n",
 		FBCON_COMMON_MSG, common_factor);
@@ -296,9 +300,6 @@
 		"Your device will boot in 5 seconds\n\n", FBCON_COMMON_MSG, common_factor);
 
 	msg_info->info.msg_type = type;
-	if(str_target) {
-		free(str_target);
-	}
 
 	/* Initialize the time out time */
 	msg_info->info.timeout_time = 5000; //5s