• Oran Agra's avatar
    Fix memory leaks in error replies due to recent change (#8249) · 049cf8cd
    Oran Agra authored
    Recently efaf09ee started using addReplyErrorSds in place of
    addReplySds the later takes ownership of the string but the former did
    not.
    This introduced memory leaks when a script returns an error to redis,
    and also in clusterRedirectClient (two new usages of
    addReplyErrorSds which was mostly unused till now.
    
    This commit chagnes two thanks.
    1. change addReplyErrorSds to take ownership of the error string.
    2. scripting.c doesn't actually need to use addReplyErrorSds, it's a
    perfect match for addReplyErrorFormat (replaces newlines with spaces)
    049cf8cd
networking.c 136 KB