Re: [PATCH] src: Avoid needless checks before calling g_strdup()

2023-09-18 Thread Ján Tomko
On a Monday in 2023, Michal Privoznik wrote: There are few places where the following pattern occurs: if (var) other = g_strdup(var); where @other wasn't initialized before g_strdup(). Checking for var != NULL is useless in this case, as that's exactly what g_strdup() does (in which case

[PATCH] src: Avoid needless checks before calling g_strdup()

2023-09-18 Thread Michal Privoznik
There are few places where the following pattern occurs: if (var) other = g_strdup(var); where @other wasn't initialized before g_strdup(). Checking for var != NULL is useless in this case, as that's exactly what g_strdup() does (in which case it returns NULL). Signed-off-by: Michal