@@ -1211,15 +1211,15 @@ void test_status_worktree__with_directory_in_pathlist(void)
1211
1211
const git_status_entry * status ;
1212
1212
size_t i , entrycount ;
1213
1213
bool native_ignore_case ;
1214
+ char * subdir_path = "subdir" ;
1214
1215
1215
1216
cl_git_pass (git_repository_index (& index , repo ));
1216
1217
native_ignore_case =
1217
1218
(git_index_caps (index ) & GIT_INDEXCAP_IGNORE_CASE ) != 0 ;
1218
1219
git_index_free (index );
1219
1220
1221
+ opts .pathspec .strings = & subdir_path ;
1220
1222
opts .pathspec .count = 1 ;
1221
- opts .pathspec .strings = malloc (opts .pathspec .count * sizeof (char * ));
1222
- opts .pathspec .strings [0 ] = "subdir" ;
1223
1223
opts .flags =
1224
1224
GIT_STATUS_OPT_DEFAULTS |
1225
1225
GIT_STATUS_OPT_INCLUDE_UNMODIFIED |
@@ -1240,6 +1240,8 @@ void test_status_worktree__with_directory_in_pathlist(void)
1240
1240
status -> index_to_workdir -> old_file .path );
1241
1241
}
1242
1242
1243
+ git_status_list_free (statuslist );
1244
+
1243
1245
opts .show = GIT_STATUS_SHOW_INDEX_ONLY ;
1244
1246
git_status_list_new (& statuslist , repo , & opts );
1245
1247
@@ -1255,6 +1257,8 @@ void test_status_worktree__with_directory_in_pathlist(void)
1255
1257
status -> head_to_index -> old_file .path );
1256
1258
}
1257
1259
1260
+ git_status_list_free (statuslist );
1261
+
1258
1262
opts .show = GIT_STATUS_SHOW_INDEX_AND_WORKDIR ;
1259
1263
git_status_list_new (& statuslist , repo , & opts );
1260
1264
@@ -1269,5 +1273,7 @@ void test_status_worktree__with_directory_in_pathlist(void)
1269
1273
testrepo2_subdir_paths [i ],
1270
1274
status -> index_to_workdir -> old_file .path );
1271
1275
}
1276
+
1277
+ git_status_list_free (statuslist );
1272
1278
}
1273
1279
0 commit comments