X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/f74f4f32805a96d5079b90455264a160d91be3af..30a821969dcd507dc7da2583fa0134492dfd82b2:/lib/client.c diff --git a/lib/client.c b/lib/client.c index d9023a9..2cbcfa7 100644 --- a/lib/client.c +++ b/lib/client.c @@ -519,7 +519,7 @@ int disorder_close(disorder_client *c) { c->ident = 0; xfree(c->user); c->user = 0; - return 0; + return ret; } /** @brief Play a track @@ -653,6 +653,7 @@ static int disorder_somequeue(disorder_client *c, if(!strcmp(l, ".")) { *qt = 0; *qp = qh; + xfree(l); return 0; } q = xmalloc(sizeof *q); @@ -660,6 +661,7 @@ static int disorder_somequeue(disorder_client *c, *qt = q; qt = &q->next; } + xfree(l); } if(ferror(c->fpin)) { byte_xasprintf((char **)&c->last, "input error: %s", strerror(errno)); @@ -712,9 +714,11 @@ static int readlist(disorder_client *c, char ***vecp, int *nvecp) { if(nvecp) *nvecp = v.nvec; *vecp = v.vec; + xfree(l); return 0; } - vector_append(&v, l + (*l == '.')); + vector_append(&v, xstrdup(l + (*l == '.'))); + xfree(l); } if(ferror(c->fpin)) { byte_xasprintf((char **)&c->last, "input error: %s", strerror(errno)); @@ -865,7 +869,9 @@ int disorder_prefs(disorder_client *c, const char *track, struct kvp **kp) { k->name = pvec[0]; k->value = pvec[1]; kp = &k->next; + xfree(pvec); } + free_strings(nvec, vec); *kp = 0; return 0; }