Don't need null checks for g_free
commite95f44cc10a60429b55fa7e785a174bf833ce8d5
authorMichael Terry <mike@mterry.name>
dateTue 14 Mar 2017, 15:28 (10 years ago)
parent741db99
tests/plugins/Unity/Session/preload.c+2−4
@@ -29,10 +29,8 @@ struct group *getgrnam(const char *group_name)
2929{
3030 static struct group rv = {NULL, NULL, 0, NULL};
3131
32− if (rv.gr_name) {
33− g_free(rv.gr_name);
34− g_strfreev(rv.gr_mem);
35− }
32+ g_free(rv.gr_name);
33+ g_strfreev(rv.gr_mem);
3634
3735 rv.gr_name = g_strdup(group_name);
3836 rv.gr_passwd = NULL;