repositories
/
deb_libnfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a very subtle bug in nfs_set_error()
[deb_libnfs.git]
/
lib
/
libnfs.c
diff --git
a/lib/libnfs.c
b/lib/libnfs.c
index 43806538d6c3cb9871f268b7a09eb604370f78ba..996b9880a91c232d8627b1470fa7b658046032d5 100644
(file)
--- 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;
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);
}
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);
}
nfs->rpc->error_string = str;
va_end(ap);
}