wget-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wget2 | Draft: Small fixes (!505)


From: Avinash Sonawane (@rootkea)
Subject: Re: wget2 | Draft: Small fixes (!505)
Date: Wed, 27 Apr 2022 13:12:57 +0000



Avinash Sonawane commented on a discussion on libwget/cookie.c: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/505#note_926041513

>  wget_cookie_db *wget_cookie_db_init(wget_cookie_db *cookie_db)
>  {
>       if (!cookie_db) {
> -             cookie_db = wget_malloc(sizeof(wget_cookie_db));
> +             cookie_db = wget_calloc(1, sizeof(wget_cookie_db));
>               if (!cookie_db)
>                       return NULL;
>       }
>  
> -     memset(cookie_db, 0, sizeof(*cookie_db));

BTW, I still went ahead with `calloc` and calling `memset()` only if 
`cookie_db` is non-NULL. I think it looks okay now but do let me know if 
something needs to be changed.

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/505#note_926041513
You're receiving this email because of your account on gitlab.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]