libplumb: fix old leak introduced in 18b8ed1a5ea3
This commit is contained in:
parent
02e584c06c
commit
12716019bf
1 changed files with 3 additions and 1 deletions
|
@ -95,8 +95,10 @@ plumbpackattr(Plumbattr *attr)
|
||||||
for(a=attr; a!=nil; a=a->next)
|
for(a=attr; a!=nil; a=a->next)
|
||||||
n += Strlen(a->name) + 1 + Strlen(quote(a->value, buf, bufe)) + 1;
|
n += Strlen(a->name) + 1 + Strlen(quote(a->value, buf, bufe)) + 1;
|
||||||
s = malloc(n);
|
s = malloc(n);
|
||||||
if(s == nil)
|
if(s == nil){
|
||||||
|
free(buf);
|
||||||
return nil;
|
return nil;
|
||||||
|
}
|
||||||
t = s;
|
t = s;
|
||||||
*t = '\0';
|
*t = '\0';
|
||||||
for(a=attr; a!=nil; a=a->next){
|
for(a=attr; a!=nil; a=a->next){
|
||||||
|
|
Loading…
Reference in a new issue