Add error return and null checker
[platform/core/uifw/stt.git] / common / stt_engine.c
index 2c65e04..6e3498f 100644 (file)
@@ -360,8 +360,10 @@ int stt_engine_get_first_language(char** language)
                while (NULL != iter) {
                        data = iter->data;
 
-                       if (NULL != data)
+                       if (NULL != data) {
                                free(data);
+                               data = NULL;
+                       }
 
                        lang_list = g_slist_remove_link(lang_list, iter);