Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

fix a few strdup memory leaks - #85

Merged
bergwolf merged 2 commits into
hyperhq:masterfrom
bergwolf:strdup
Apr 29, 2016
Merged

bergwolf merged 2 commits into
hyperhq:masterfrom
bergwolf:strdup

Conversation

@bergwolf

Copy link
Copy Markdown
Member

No description provided.

@bergwolf
bergwolf force-pushed the strdup branch 2 times, most recently from 9556f7f to 2b7c546 Compare April 27, 2016 19:41
@gao-feng

Copy link
Copy Markdown
Contributor

lgtm, need rebase

Signed-off-by: Peng Tao <bergwolf@gmail.com>
We are overriding container->image when passed container->scsiaddr. Make
sure we also free its memory if caller also passes the image field.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
@bergwolf

Copy link
Copy Markdown
Member Author

rebased.

@bergwolf
bergwolf merged commit 402a930 into hyperhq:master Apr 29, 2016
Comment thread src/container.c
if (container->scsiaddr)
if (container->scsiaddr) {
free(container->image);
hyper_find_sd(container->scsiaddr, &container->image);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it causes double free.
hyper_find_sd() already free it.

@laijs laijs mentioned this pull request May 4, 2016
@bergwolf
bergwolf deleted the strdup branch June 8, 2016 03:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants