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

Fix evict.c mem_freed variable init #13096

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

LufeiCheng
Copy link

Fix evict.c mem_freed variable init, Prevent unknown behavior

@@ -545,7 +545,7 @@ int performEvictions(void) {

int keys_freed = 0;
size_t mem_reported, mem_tofree;
long long mem_freed; /* May be negative */
long long mem_freed = 0; /* May be negative */
Copy link
Collaborator

Choose a reason for hiding this comment

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

but it is initialized to 0 in line 566,
if need we also need to delete line 566 at the same time.
i'm not sure we need to bother it, although looks werid.

btw: the reason for it being initialized on a separate line: 4a140d3

@@ -545,7 +545,7 @@ int performEvictions(void) {

int keys_freed = 0;
size_t mem_reported, mem_tofree;
long long mem_freed; /* May be negative */
long long mem_freed = 0; /* May be negative */
mstime_t latency, eviction_latency;
long long delta;
int slaves = listLength(server.slaves);
Copy link

Choose a reason for hiding this comment

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

Please remove mem_freed = 0 from line 566

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

None yet

4 participants