if (!url)
return -1;
- if (url->backend != cl->backend)
+ if (url->backend != cl->backend) {
+ free(url);
return -1;
+ }
free(cl->url);
cl->url = url;
free(url);
}
-int uclient_write(struct uclient *cl, char *buf, int len)
+int uclient_write(struct uclient *cl, const char *buf, int len)
{
if (!cl->backend->write)
return -1;