File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3246,14 +3246,18 @@ int git_repository_set_workdir(
3246
3246
if (git_fs_path_prettify_dir (& path , workdir , NULL ) < 0 )
3247
3247
return -1 ;
3248
3248
3249
- if (repo -> workdir && strcmp (repo -> workdir , path .ptr ) == 0 )
3249
+ if (repo -> workdir && strcmp (repo -> workdir , path .ptr ) == 0 ) {
3250
+ git_str_dispose (& path );
3250
3251
return 0 ;
3252
+ }
3251
3253
3252
3254
if (update_gitlink ) {
3253
3255
git_config * config ;
3254
3256
3255
- if (git_repository_config__weakptr (& config , repo ) < 0 )
3257
+ if (git_repository_config__weakptr (& config , repo ) < 0 ) {
3258
+ git_str_dispose (& path );
3256
3259
return -1 ;
3260
+ }
3257
3261
3258
3262
error = repo_write_gitlink (path .ptr , git_repository_path (repo ), false);
3259
3263
@@ -3275,6 +3279,7 @@ int git_repository_set_workdir(
3275
3279
3276
3280
git__free (old_workdir );
3277
3281
}
3282
+ git_str_dispose (& path );
3278
3283
3279
3284
return error ;
3280
3285
}
You can’t perform that action at this time.
0 commit comments