git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e909c5e
)
Don't dereference or free undefined "msg" upon OOM.
author
Jim Meyering
<meyering@redhat.com>
Wed, 1 Jul 2009 13:45:01 +0000
(15:45 +0200)
committer
Jim Meyering
<meyering@redhat.com>
Wed, 1 Jul 2009 14:30:46 +0000
(16:30 +0200)
* src/guestfs.c (guestfs_error): Handle failing vasprintf.
src/guestfs.c
patch
|
blob
|
history
diff --git
a/src/guestfs.c
b/src/guestfs.c
index
5743a07
..
87b0d86
100644
(file)
--- a/
src/guestfs.c
+++ b/
src/guestfs.c
@@
-404,9
+404,11
@@
guestfs_error (guestfs_h *g, const char *fs, ...)
char *msg;
va_start (args, fs);
- vasprintf (&msg, fs, args);
+
int err =
vasprintf (&msg, fs, args);
va_end (args);
+ if (err < 0) return;
+
if (g->error_cb) g->error_cb (g, g->error_cb_data, msg);
set_last_error (g, msg);