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

Use after free error #120

Open
Xazax-hun opened this issue Aug 15, 2019 · 0 comments
Open

Use after free error #120

Xazax-hun opened this issue Aug 15, 2019 · 0 comments

Comments

@Xazax-hun
Copy link

I am working on some new compiler warnings and stumbled upon the following warning:

/home/tgahor/data/projects/P0267_RefImpl/P0267_RefImpl/P0267_RefImpl/cairo/xlib/xio2d_cairo_xlib_output_surfaces.h:329:19: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling]
                                                                auto es = clientMsgStr.str().c_str();
                                                                          ^~~~~~~~~~~~~~~~~~

This looks like a true positive as the pointer returned by c_str() will dangle after the end of the full expression.

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

No branches or pull requests

1 participant