X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flibnfs.c;h=97663ac658ff2fe4d2285b7833c2c5bb8c79482b;hb=cb5b8be2eb2d5b6d837e9f1ae20001e186f4aac2;hp=93cd62902a081d9fb7d3679e0a3c10011d05bdae;hpb=73f4ae7cca447767dbcf4e574e585be007d3be47;p=deb_libnfs.git diff --git a/lib/libnfs.c b/lib/libnfs.c index 93cd629..97663ac 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -30,6 +30,7 @@ #else #include #include +#include #endif /*WIN32*/ #ifdef ANDROID @@ -59,7 +60,6 @@ #include #include #include -#include #include "libnfs-zdr.h" #include "libnfs.h" #include "libnfs-raw.h" @@ -1675,10 +1675,10 @@ static void nfs_create_2_cb(struct rpc_context *rpc, int status, void *command_d } memset(nfsfh, 0, sizeof(struct nfsfh)); - /* steal the filehandle */ - nfsfh->fh.data.data_len = data->fh.data.data_len; - nfsfh->fh.data.data_val = data->fh.data.data_val; - data->fh.data.data_val = NULL; + /* copy the filehandle */ + nfsfh->fh.data.data_len = res->LOOKUP3res_u.resok.object.data.data_len; + nfsfh->fh.data.data_val = malloc(nfsfh->fh.data.data_len); + memcpy(nfsfh->fh.data.data_val, res->LOOKUP3res_u.resok.object.data.data_val, nfsfh->fh.data.data_len); data->cb(0, nfs, nfsfh, data->private_data); free_nfs_cb_data(data);