Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent rmdir on non-empty directory (#444) (#445) (#446) #447

Merged
merged 1 commit into from
Feb 12, 2018

Conversation

jerryblakley
Copy link
Contributor

No description provided.

// Ignore negative (non-existent) entries, those tagged with st_mode == 0
if (entry->value->st.st_mode != 0) {
has_children = true;
log_print(LOG_DEBUG, SECTION_STATCACHE_CACHE, "stat_cache_dir_has_child(%s); entry \'%s\'", path, entry->key);
free(entry);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer that we make use of a singular free() for all loop iterations rather than free() + break for some. Alternatively, it can work to set the pointer to a null value and only free if it's non-null at the end of the loop.

@jerryblakley jerryblakley merged commit 9dbdbad into master Feb 12, 2018
@jerryblakley jerryblakley deleted the stage branch February 21, 2018 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants