From 12716019bfdc3bedda1c8489d87a7cd316d016ef Mon Sep 17 00:00:00 2001 From: mischief Date: Thu, 3 May 2018 01:26:09 -0700 Subject: [PATCH] libplumb: fix old leak introduced in 18b8ed1a5ea3 --- sys/src/libplumb/mesg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/src/libplumb/mesg.c b/sys/src/libplumb/mesg.c index 5b111f679..e8aa2b5ad 100644 --- a/sys/src/libplumb/mesg.c +++ b/sys/src/libplumb/mesg.c @@ -95,8 +95,10 @@ plumbpackattr(Plumbattr *attr) for(a=attr; a!=nil; a=a->next) n += Strlen(a->name) + 1 + Strlen(quote(a->value, buf, bufe)) + 1; s = malloc(n); - if(s == nil) + if(s == nil){ + free(buf); return nil; + } t = s; *t = '\0'; for(a=attr; a!=nil; a=a->next){