Projects
Eulaceura:Factory
scrub
_service:obs_scm:Fix-leak-in-refill_init.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:Fix-leak-in-refill_init.patch of Package scrub
From 62bc12807948c0e9688e5810769a4f48d3e223dd Mon Sep 17 00:00:00 2001 From: Sergio Correia <scorreia@redhat.com> Date: Wed, 17 Mar 2021 08:06:23 -0300 Subject: [PATCH] Fix leak in refill_init() When allocating the buffer fails in refill_init(), we returned without free()ing `mp', which we had just allocated. --- src/fillfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fillfile.c b/src/fillfile.c index 3992cee..0423764 100644 --- a/src/fillfile.c +++ b/src/fillfile.c @@ -116,8 +116,10 @@ refill_init(struct memstruct **mpp, refill_t refill, int memsize) if (!(mp = malloc(sizeof(struct memstruct)))) goto nomem; - if (!(mp->buf = malloc(memsize))) + if (!(mp->buf = malloc(memsize))) { + free(mp); goto nomem; + } mp->size = memsize; mp->refill = refill; #if WITH_PTHREADS -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2