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

src/ring.c: resource leak suspected by coverity #2504

Open
chipitsine opened this issue Mar 26, 2024 · 0 comments
Open

src/ring.c: resource leak suspected by coverity #2504

chipitsine opened this issue Mar 26, 2024 · 0 comments
Labels
type: code-report This issue describes a code report (like valgrind or coverity)

Comments

@chipitsine
Copy link
Member

Tool Name and Version

coverity

Code Report

*** CID 1540881:  Resource leaks  (RESOURCE_LEAK)
/src/ring.c: 146 in ring_resize()
140                     len = vp_size(v1, v2);
141                     vp_peek_ofs(v1, v2, 0, new->area, len);
142                     new->size = size - sizeof(*ring->storage);
143                     new->rsvd = sizeof(*ring->storage);
144                     new->head = 0;
145                     new->tail = len;
>>>     CID 1540881:  Resource leaks  (RESOURCE_LEAK)
>>>     Overwriting "new" in "new = __atomic_exchange_n (&ring->storage, 4, new)" leaks the storage that "new" points to.
146                     new = HA_ATOMIC_XCHG(&ring->storage, new);
147             }
148     
149             thread_release();
150     
151             /* free the unused one */

Additional Information

No response

Output of haproxy -vv

no
@chipitsine chipitsine added the type: code-report This issue describes a code report (like valgrind or coverity) label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: code-report This issue describes a code report (like valgrind or coverity)
Projects
None yet
Development

No branches or pull requests

1 participant