Skip to content

transfrom_data结构体是否存在内存泄漏? #2

@toints

Description

@toints

在range_header_check(TSHttpTxn txnp){} 函数中,txn_state->range_value = TSstrndup(hdr_value, length);
而在ats的文档中,对TSstrdup()函数,有如下说明:
func:TSstrdup returns a pointer to a new string that is a duplicate of the string pointed to by str. The memory for the new string is allocated using :func:TSmalloc and should be freed by a call to
:func:TSfree.

在transfrom_data_destroy(TransfromData * data)函数中,只是TSfree(data),这个会释放data->range_value么,我觉得应该需要先调用TSfree(data->range_value)。因为代码中并没有显示释放这块内存。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions