Skip to content

Commit

Permalink
fix resource leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Shubham Vasudeo Desai committed Oct 27, 2024
1 parent ffcb9e1 commit db1d488
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/gis/copy_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ int G_recursive_copy(const char *src, const char *dst)
sprintf(path, "%s/%s", src, dp->d_name);
sprintf(path2, "%s/%s", dst, dp->d_name);

if (G_recursive_copy(path, path2) != 0)
if (G_recursive_copy(path, path2) != 0) {
closedir(dirp);
return 1;
}
}

closedir(dirp);
Expand Down

0 comments on commit db1d488

Please sign in to comment.