fixup! Fix some vulnerability (Null Pointer Dereference) defects
[platform/core/multimedia/libmm-sound.git] / testsuite / mm_sound_testsuite_simple.c
index 4bfc7fb..f72e2fd 100755 (executable)
@@ -803,6 +803,11 @@ static void interpret(char *cmd)
                        if (basedir != NULL) {
                                entry_len = offsetof(struct dirent, d_name) + fpathconf(dirfd(basedir), MAX_STRING_LEN) + 1;
                                prev_entry = malloc(entry_len);
+                               if (prev_entry == NULL) {
+                                       debug_error("malloc error");
+                                       closedir(basedir);
+                                       break;
+                               }
 
                                while (1) {
                                        int playfail = 0;