Bug 21932 - Unpaired __resolv_context_get in generic get*_r implementation
Summary: Unpaired __resolv_context_get in generic get*_r implementation
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: network (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: 2.27
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-09 14:25 UTC by Florian Weimer
Modified: 2017-08-10 07:12 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Weimer 2017-08-09 14:25:57 UTC
The generic get*_r function calls __resolv_context_get without a matching __resolv_context_put on all return paths.

This was found during code review.  The impact is a minor memory leak.
Comment 1 Sourceware Commits 2017-08-09 15:48:09 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  3016149819268b14660f791b971910ccc2cc13e5 (commit)
      from  756d1699896e62445196c3137a982a990a8e8847 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3016149819268b14660f791b971910ccc2cc13e5

commit 3016149819268b14660f791b971910ccc2cc13e5
Author: Florian Weimer <fweimer@redhat.com>
Date:   Wed Aug 9 17:46:04 2017 +0200

    nss: Call __resolv_context_put before early return in get*_r [BZ #21932]
    
    This corrects an oversight introduced in commit
    352f4ff9a268b81ef5d4b2413f582565806e4790 (resolv: Introduce struct
    resolv_context).

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |    6 ++++++
 nss/getXXbyYY_r.c |   10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)
Comment 2 Florian Weimer 2017-08-09 15:48:21 UTC
Fixed in 2.27.
Comment 3 Sourceware Commits 2017-08-10 07:12:04 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, release/2.26/master has been updated
       via  302434688d925134065498b4a5574f6ee6bfb9fd (commit)
      from  82efa1ffd43bed1494d20a4b86f6b15ac6bb5545 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=302434688d925134065498b4a5574f6ee6bfb9fd

commit 302434688d925134065498b4a5574f6ee6bfb9fd
Author: Florian Weimer <fweimer@redhat.com>
Date:   Thu Aug 10 09:10:36 2017 +0200

    nss: Call __resolv_context_put before early return in get*_r [BZ #21932]
    
    This corrects an oversight introduced in commit
    352f4ff9a268b81ef5d4b2413f582565806e4790 (resolv: Introduce struct
    resolv_context).
    
    (cherry picked from commit 3016149819268b14660f791b971910ccc2cc13e5)

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |    6 ++++++
 NEWS              |    1 +
 nss/getXXbyYY_r.c |   10 +++++++++-
 3 files changed, 16 insertions(+), 1 deletions(-)