#2369 check correct usage of talloc_realloc
Closed: Fixed None Opened 9 years ago by preichl.

When talloc_ralloc called with count parameter equal to zero it frees context and returns NULL. This seems to be potential source of problems as developers assumes that return value NULL implies ENOMEM.

It may be correct in some case to do something like this:

missing = talloc_realloc(mem_ctx, missing,
                         struct sdap_nested_group_member, num_missing);
-    if (missing == NULL) {
+    if (missing == NULL && num_missing != 0) {
         return ENOMEM;

One patch landed in master: 759fd29

Fields changed

keywords: => easyfix

Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.14 beta
rhbz: => 0

This might be a nice task if we have time in 1.14..

mark: => 0
milestone: SSSD 1.14 beta => SSSD 1.14 backlog
sensitive: => 0

I've checked the source code, there is any case where it can happen apart from the one fixed by 759fd29.

This bug can be closed.

Thank you very much for checking. I'm closing the ticket.

owner: somebody => fidencio

Fields changed

milestone: SSSD 1.14 backlog => SSSD 1.14 alpha
resolution: => fixed
status: new => closed

Metadata Update from @preichl:
- Issue assigned to fidencio
- Issue set to the milestone: SSSD 1.14 alpha

7 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/3411

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.

Metadata