static int parse_icy(HTTPContext *s, const char *tag, const char *p)
{
    int len = 4 + strlen(p) + strlen(tag);
    int is_first = !s->icy_metadata_headers;
    int ret;
    if (s->icy_metadata_headers)
        len += strlen(s->icy_metadata_headers);
    if ((ret = av_reallocp(&s->icy_metadata_headers, len)) < 0)
        return ret;
    if (is_first)
        *s->icy_metadata_headers = '\0';
    av_strlcatf(s->icy_metadata_headers, len, "%s: %s\n", tag, p);
    return 0;
}
['static int parse_icy(HTTPContext *s, const char *tag, const char *p)\n{\n    int len = 4 + strlen(p) + strlen(tag);\n    int is_first = !s->icy_metadata_headers;\n    int ret;\n    if (s->icy_metadata_headers)\n        len += strlen(s->icy_metadata_headers);\n    if ((ret = av_reallocp(&s->icy_metadata_headers, len)) < 0)\n        return ret;\n    if (is_first)\n        *s->icy_metadata_headers = \'\\0\';\n    av_strlcatf(s->icy_metadata_headers, len, "%s: %s\\n", tag, p);\n    return 0;\n}', 'int av_reallocp(void *ptr, size_t size)\n{\n    void **ptrptr = ptr;\n    void *ret;\n    if (!size) {\n        av_freep(ptr);\n        return 0;\n    }\n    ret = av_realloc(*ptrptr, size);\n    if (!ret) {\n        av_freep(ptr);\n        return AVERROR(ENOMEM);\n    }\n    *ptrptr = ret;\n    return 0;\n}', 'void av_freep(void *arg)\n{\n    void **ptr = (void **)arg;\n    av_free(*ptr);\n    *ptr = NULL;\n}', 'void av_free(void *ptr)\n{\n#if CONFIG_MEMALIGN_HACK\n    if (ptr)\n        free((char *)ptr - ((char *)ptr)[-1]);\n#elif HAVE_ALIGNED_MALLOC\n    _aligned_free(ptr);\n#else\n    free(ptr);\n#endif\n}']