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

[内存泄漏][{CPP}] {add-two-numbers} #1549

Open
2 tasks done
GodLoong1 opened this issue Feb 12, 2024 · 0 comments
Open
2 tasks done

[内存泄漏][{CPP}] {add-two-numbers} #1549

GodLoong1 opened this issue Feb 12, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@GodLoong1
Copy link

请在提交 bug 之前先搜索

  • 我已经搜索过 issues,没有发现相同的 bug。

出错的题目链接

https://leetcode.cn/problems/add-two-numbers/

报错信息

ListNode *dummy = new ListNode(-1); // 内存泄漏
ListNode *p = dummy;

ListNode dummy; // 正确写法
ListNode *p = &dummy;

你是否愿意提交 PR 修复这个 bug?

  • 我愿意!
@GodLoong1 GodLoong1 added the help wanted Extra attention is needed label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant