diff --git a/libobs/obs-module.c b/libobs/obs-module.c
index 84b2848c08655df6e37646a020e544910b49766a..a9ac5d0d4ad6356e614c83f8f3fac03e1828253c 100644
--- a/libobs/obs-module.c
+++ b/libobs/obs-module.c
@@ -193,13 +193,8 @@ static char *make_data_directory(const char *module_name, const char *data_dir)
 
 	found = os_file_exists(parsed_data_dir.array);
 
-	if (!found && astrcmpi_n(module_name, "lib", 3) == 0) {
+	if (!found && astrcmpi_n(module_name, "lib", 3) == 0)
 		make_data_dir(&parsed_data_dir, data_dir, module_name + 3);
-		found = os_file_exists(parsed_data_dir.array);
-	}
-
-	if (!found)
-		dstr_free(&parsed_data_dir);
 
 	return parsed_data_dir.array;
 }