Skip to content

Fix nonce1 and sessionid memory leak - #316

Merged
troky merged 1 commit into
sgminer-dev:v5_0from
elbandi:v5_0-leakfix
Jul 3, 2014
Merged

troky merged 1 commit into
sgminer-dev:v5_0from
elbandi:v5_0-leakfix

Conversation

@elbandi

@elbandi elbandi commented Jul 3, 2014

Copy link
Copy Markdown
Contributor

Free the memory before set new value

troky added a commit that referenced this pull request Jul 3, 2014
Fix nonce1 and sessionid memory leak
@troky
troky merged commit 8567370 into sgminer-dev:v5_0 Jul 3, 2014
@mrbrdo

mrbrdo commented Jul 3, 2014

Copy link
Copy Markdown
Contributor

@elbandi Are you sure about the part in initiate_stratum? I think those values can also be uninitialized there (the first time initiate_stratum is called for the pool). Or am I missing where they are set before that?

@mrbrdo

mrbrdo commented Jul 3, 2014

Copy link
Copy Markdown
Contributor

I guess it works because it is initialized to NULL and free will just ignore it. I guess it's fine then.

@elbandi

elbandi commented Jul 3, 2014

Copy link
Copy Markdown
Contributor Author

Yeah, this pool struct allocated by calloc at https://github.com/sgminer-dev/sgminer/blob/v5_0/sgminer.c#L516

@elbandi
elbandi deleted the v5_0-leakfix branch July 3, 2014 17:32
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.

3 participants