[Top][All Lists]

[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: Mon, 06 Jun 2022 10:51:06 +0000

Avinash Sonawane commented on a discussion on libwget/cookie.c: 

>  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));

Maybe not. But we have used this exact idiom of  `if (!foo) calloc() else 
memset()` at multiple places in the codebase. In ocsp.c, netrc.c, hsts.c, 
hpkp.c, tls_session.c etc.

So why not go for code consistency especially when there is no efficiency cost 

Reply to this email directly or view it on GitLab: 
You're receiving this email because of your account on gitlab.com.

reply via email to

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