From: Andre Noll Date: Sat, 22 Sep 2007 11:34:12 +0000 (+0200) Subject: Fix com_lsblob(). X-Git-Tag: v0.3.0~380 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=ab6cab06766f86086b53f2720d566f7ddf70db4c;p=paraslash.git Fix com_lsblob(). In case no output was produced, don't access output data and don't free it. --- diff --git a/blob.c b/blob.c index 55956450..c6b05b2b 100644 --- a/blob.c +++ b/blob.c @@ -138,9 +138,10 @@ static int com_lsblob(callback_function *f, int fd, int argc, char * const * con return -E_BLOB_SYNTAX; ret = send_option_arg_callback_request(&query, argc - i, argv + i, f, &ls_output); - if (ret >= 0 && ls_output.data) + if (ret > 0) { send_buffer(fd, (char *)ls_output.data); - free(ls_output.data); + free(ls_output.data); + } return ret; }