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

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

     [ https://issues.apache.org/jira/browse/TS-4577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Sorber resolved TS-4577.
-----------------------------
    Resolution: Fixed

> 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)