diff options
author | mischief <mischief@offblast.org> | 2018-05-03 01:26:09 -0700 |
---|---|---|
committer | mischief <mischief@offblast.org> | 2018-05-03 01:26:09 -0700 |
commit | 12716019bfdc3bedda1c8489d87a7cd316d016ef (patch) | |
tree | a9d45736d98ba912000a702b074f026c6e3aef4c /sys/src/libplumb | |
parent | 02e584c06c507a7802ed160ff954fa9fd080265c (diff) |
libplumb: fix old leak introduced in 18b8ed1a5ea3
Diffstat (limited to 'sys/src/libplumb')
-rw-r--r-- | sys/src/libplumb/mesg.c | 4 |
1 files changed, 3 insertions, 1 deletions
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){ |