radix rn_inithead: Fix minor leak in low memory conditions

R_Zalloc is essentially a malloc(M_NOWAIT) wrapper.  It is possible that 'rnh'
failed to allocate, but 'rmh' succeeds.  In that case, we bail out of
rn_inithead() but previously did not free 'rmh'.

Introduced in r287073 (projects/routing) / MFP r294706.

Reported by:	Coverity
CID:		1350258
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Conrad Meyer 2016-04-20 02:01:45 +00:00
parent 5412ec6e3f
commit 856d8ddbb3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=298329

View File

@ -1156,6 +1156,8 @@ rn_inithead(void **head, int off)
if (rnh == NULL || rmh == NULL) {
if (rnh != NULL)
R_Free(rnh);
if (rmh != NULL)
R_Free(rmh);
return (0);
}