X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flibnfs.c;h=8d27a816b0fa079b6a28a090aa764a99767b08f1;hb=5e9910f0f0b2a1c71a08e910e7123efcadef46bf;hp=43806538d6c3cb9871f268b7a09eb604370f78ba;hpb=e4a5ba42b8212574a6c75ac518e7b3be6e619a5b;p=deb_libnfs.git diff --git a/lib/libnfs.c b/lib/libnfs.c index 4380653..8d27a81 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -890,6 +890,7 @@ static void nfs_pread_mcb(struct rpc_context *rpc _U_, int status, void *command data->nfsfh->offset = data->max_offset; data->cb(data->max_offset - data->start_offset, nfs, data->buffer, data->private_data); + free_nfs_cb_data(data); free(mdata); } @@ -925,6 +926,7 @@ int nfs_pread_async(struct nfs_context *nfs, struct nfsfh *nfsfh, off_t offset, * reads and collect into a reassembly buffer. * we send all reads in parallell so that performance is still good. */ + data->max_offset = offset; data->start_offset = offset; data->buffer = malloc(count); @@ -2865,13 +2867,13 @@ size_t nfs_get_writemax(struct nfs_context *nfs) void nfs_set_error(struct nfs_context *nfs, char *error_string, ...) { va_list ap; - char *str; + char *str = NULL; + va_start(ap, error_string); + vasprintf(&str, error_string, ap); if (nfs->rpc->error_string != NULL) { free(nfs->rpc->error_string); } - va_start(ap, error_string); - vasprintf(&str, error_string, ap); nfs->rpc->error_string = str; va_end(ap); }