You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/06/24 16:17:16 UTC

[jira] [Commented] (TS-4577) Coverity Resource leaks in remap_stats.cc

    [ https://issues.apache.org/jira/browse/TS-4577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15348498#comment-15348498 ] 

ASF GitHub Bot commented on TS-4577:
------------------------------------

GitHub user strotyl opened a pull request:

    https://github.com/apache/trafficserver/pull/738

    TS-4577 remap_stats: Fix memory leak

    This is fixing CID 1356995 & 1356996.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/strotyl/trafficserver TS-4577

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/738.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #738
    
----
commit b643bec071c3193e7d75fe24c99ef74796be138d
Author: Tyler Stroh <ts...@apple.com>
Date:   2016-06-24T14:29:03Z

    TS-4577 remap_stats: Fix memory leak
    
    This is fixing CID 1356995 & 1356996.

----


> Coverity Resource leaks in remap_stats.cc
> -----------------------------------------
>
>                 Key: TS-4577
>                 URL: https://issues.apache.org/jira/browse/TS-4577
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Plugins
>            Reporter: Leif Hedstrom
>            Assignee: Tyler Stroh
>             Fix For: 7.0.0
>
>
> {code}
> ** CID 1356996:  Resource leaks  (RESOURCE_LEAK)
> /plugins/experimental/remap_stats/remap_stats.c: 105 in get_effective_host()
> ________________________________________________________________________________________________________
> *** CID 1356996:  Resource leaks  (RESOURCE_LEAK)
> /plugins/experimental/remap_stats/remap_stats.c: 105 in get_effective_host()
> 99       TSMLoc url_loc;
> 100     
> 101       effective_url = TSHttpTxnEffectiveUrlStringGet(txn, &len);
> 102       buf           = TSMBufferCreate();
> 103       if (TS_SUCCESS != TSUrlCreate(buf, &url_loc)) {
> 104         TSDebug(DEBUG_TAG, "unable to create url");
>    CID 1356996:  Resource leaks  (RESOURCE_LEAK)
>    Variable "buf" going out of scope leaks the storage it points to.
> 105         return NULL;
> 106       }
> 107       tmp = effective_url;
> 108       TSUrlParse(buf, url_loc, (const char **)(&tmp), (const char *)(effective_url + len));
> 109       TSfree(effective_url);
> 110       host = TSUrlHostGet(buf, url_loc, &len);
> ** CID 1356995:  Resource leaks  (RESOURCE_LEAK)
> /plugins/experimental/remap_stats/remap_stats.c: 105 in get_effective_host()
> ________________________________________________________________________________________________________
> *** CID 1356995:  Resource leaks  (RESOURCE_LEAK)
> /plugins/experimental/remap_stats/remap_stats.c: 105 in get_effective_host()
> 99       TSMLoc url_loc;
> 100     
> 101       effective_url = TSHttpTxnEffectiveUrlStringGet(txn, &len);
> 102       buf           = TSMBufferCreate();
> 103       if (TS_SUCCESS != TSUrlCreate(buf, &url_loc)) {
> 104         TSDebug(DEBUG_TAG, "unable to create url");
>    CID 1356995:  Resource leaks  (RESOURCE_LEAK)
>    Variable "effective_url" going out of scope leaks the storage it points to.
> 105         return NULL;
> 106       }
> 107       tmp = effective_url;
> 108       TSUrlParse(buf, url_loc, (const char **)(&tmp), (const char *)(effective_url + len));
> 109       TSfree(effective_url);
> 110       host = TSUrlHostGet(buf, url_loc, &len);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)