Date: Wed, 20 May 2020 10:15:46 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 246596] Memory leak in ctld Message-ID: <bug-246596-227-2PA3Y7uJEk@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-246596-227@https.bugs.freebsd.org/bugzilla/> References: <bug-246596-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D246596 --- Comment #1 from Patryk <patrykkotlowski@gmail.com> --- Also I found another possible memory leak. In ctld.c in conf_apply fucntion there is: /* * Second, remove any LUNs present in the old configuration * and missing in the new one. */ TAILQ_FOREACH_SAFE(oldlun, &oldconf->conf_luns, l_next, tmplun) { newlun =3D lun_find(newconf, oldlun->l_name); if (newlun =3D=3D NULL) { log_debugx("lun \"%s\", CTL lun %d " "not found in new configuration; " "removing", oldlun->l_name, oldlun->l_ctl_lun); error =3D kernel_lun_remove(oldlun); if (error !=3D 0) { log_warnx("failed to remove lun \"%s\", " "CTL lun %d", oldlun->l_name, oldlun->l_ctl_lun); cumulated_error++; } continue; } Why here lun_delete function is not called before "continue;"? I next part of function where luns with changed size are deleted there is lun_delete() call:=20 if (changed) { error =3D kernel_lun_remove(oldlun); if (error !=3D 0) { log_warnx("failed to remove lun \"%s\", " "CTL lun %d", oldlun->l_name, oldlun->l_ctl_lun); cumulated_error++; } lun_delete(oldlun); continue; } I did't tested in but I think this is also memory leak. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-246596-227-2PA3Y7uJEk>