Skip to content

Commit

Permalink
lib/gis: Fix resource leak issue in copy_dir.c (#4606)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShubhamDesai authored Oct 27, 2024
1 parent 84afcf4 commit 937b2f4
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 937b2f4

Please sign in to comment.