Hi!
> This patch make 'found' a static array to avoid memory leaks.
> 
> Signed-off-by: Cyril Hrubis <chru...@suse.cz>
> Signed-off-by: Manjeet Pawar <manjee...@samsung.com>
> ---
>  utils/sctp/testlib/sctputil.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/sctp/testlib/sctputil.c b/utils/sctp/testlib/sctputil.c
> index c670af6..e7333e5 100644
> --- a/utils/sctp/testlib/sctputil.c
> +++ b/utils/sctp/testlib/sctputil.c
> @@ -370,8 +370,7 @@ int test_peer_addr(int sk, sctp_assoc_t asoc, 
> sockaddr_storage_t *peers, int cou
>       struct sockaddr *sa_addr;
>       socklen_t addrs_size = 0;
>       void *addrbuf;
> -     char *found = (char *) malloc(count);
> -     memset(found, 0, count);
> +     char found[count];
>  
>       error = sctp_getpaddrs(sk, asoc, &addrs);
>       if (-1 == error) {

I've added initialization to 0 to the else branch down below, since we
removed the memset and pushed, thanks.

-- 
Cyril Hrubis
chru...@suse.cz

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to