[Bugs] [Bug 1222898] geo-replication: fix memory leak in gsyncd

bugzilla at redhat.com bugzilla at redhat.com
Tue Jul 14 13:12:12 UTC 2015


https://bugzilla.redhat.com/show_bug.cgi?id=1222898



--- Comment #2 from Anand Avati <aavati at redhat.com> ---
COMMIT: http://review.gluster.org/10831 committed in master by Venky Shankar
(vshankar at redhat.com) 
------
commit 2ca64411fd134eb03fc8b40dec91e94027ad82b1
Author: Prasanna Kumar Kalever <prasanna.kalever at redhat.com>
Date:   Tue May 19 17:24:45 2015 +0530

    geo-replication: fix memory leak in gsyncd

    1. leak in str2argv() function:

    char *strdup(const char *s);
    The strdup() function returns a pointer to a new string which is a
    duplicate of the  string  s. Memory for the new string is obtained
    with malloc(3), and can be freed with free(3).

    so when using strdup, user has to take care of freeing the memory
    allocated by strdup library function.

    2. leak in main() function:

    str2argv() function calls calloc and allocates memory pointed to argv,
    after return from str2argv() memory pointed to argv has to be cleaned
    in main().

    This patch is to fix 2 memory leaks mentioned above.

    Change-Id: I6bf26101e0460a7324ac7bdb69905839688d4987
    BUG: 1222898
    Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever at redhat.com>
    Reviewed-on: http://review.gluster.org/10831
    Tested-by: NetBSD Build System <jenkins at build.gluster.org>
    Reviewed-by: Milind Changire <mchangir at redhat.com>
    Reviewed-by: Kotresh HR <khiremat at redhat.com>
    Reviewed-by: Venky Shankar <vshankar at redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=Khgz9zDE0Z&a=cc_unsubscribe


More information about the Bugs mailing list