X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lib%2Flibnfs.c;h=996b9880a91c232d8627b1470fa7b658046032d5;hb=1e8994af0fde29bb03c52c5c4a972ef8d8ddbc33;hp=43806538d6c3cb9871f268b7a09eb604370f78ba;hpb=e4a5ba42b8212574a6c75ac518e7b3be6e619a5b;p=deb_libnfs.git diff --git a/lib/libnfs.c b/lib/libnfs.c index 4380653..996b988 100644 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -2865,13 +2865,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); }