[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wget2 | Small fixes (!505)
From: |
@rockdaboot |
Subject: |
Re: wget2 | Small fixes (!505) |
Date: |
Sun, 24 Apr 2022 18:55:51 +0000 |
Tim Rühsen commented on a discussion on libwget/cookie.c:
https://gitlab.com/gnuwget/wget2/-/merge_requests/505#note_922054704
> 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));
This code change is buggy, as the memset zeros the cookie_db even if it already
exists. That is the reason why we don't use calloc here.
--
Reply to this email directly or view it on GitLab:
https://gitlab.com/gnuwget/wget2/-/merge_requests/505#note_922054704
You're receiving this email because of your account on gitlab.com.
- wget2 | Define _POSIX_C_SOURCE to use sigaction (!505), Avinash Sonawane (@rootkea), 2022/04/21
- Re: wget2 | Small fixes (!505), Avinash Sonawane (@rootkea), 2022/04/22
- Re: wget2 | Small fixes (!505), Avinash Sonawane (@rootkea), 2022/04/22
- Re: wget2 | Small fixes (!505), Darshit Shah (@darnir), 2022/04/24
- Re: wget2 | Small fixes (!505), Darshit Shah (@darnir), 2022/04/24
- Re: wget2 | Small fixes (!505), Darshit Shah (@darnir), 2022/04/24
- Message not available
- Re: wget2 | Small fixes (!505),
@rockdaboot <=
Re: wget2 | Small fixes (!505), @rockdaboot, 2022/04/24
Re: wget2 | Small fixes (!505), @rockdaboot, 2022/04/24
Re: wget2 | Small fixes (!505), @rockdaboot, 2022/04/24