Project

General

Profile

Bug #6031

Possible memory leak in svc_dg_create_private()

Added by Marcel Telka about 5 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
lib - userland libraries
Start date:
2015-06-24
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

In a case the malloc() call at line 158 fails we will leak the su buffer here in svc_dg_create_private():

154    su = malloc(sizeof (*su) + ucred_sz);
155    if (su == NULL)
156        goto freedata;
157    su->su_iosz = ((MAX(sendsize, recvsize) + 3) / 4) * 4;
158    if ((rpc_buffer(xprt) = malloc(su->su_iosz)) == NULL)
159        goto freedata;

Thanks to Jeffry for noticing this.

Also available in: Atom PDF