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:
c50ed37
)
ruby: Use ALLOC_N to avoid potential memory leak (RHBZ#667610).
author
Richard W.M. Jones
<rjones@redhat.com>
Tue, 15 Mar 2011 15:00:58 +0000
(15:00 +0000)
committer
Richard W.M. Jones
<rjones@redhat.com>
Tue, 15 Mar 2011 15:00:58 +0000
(15:00 +0000)
generator/generator_ruby.ml
patch
|
blob
|
history
diff --git
a/generator/generator_ruby.ml
b/generator/generator_ruby.ml
index
8be9369
..
84d10e0
100644
(file)
--- a/
generator/generator_ruby.ml
+++ b/
generator/generator_ruby.ml
@@
-367,7
+367,7
@@
get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
pr " {\n";
pr " size_t i, len;\n";
pr " len = RARRAY_LEN (%sv);\n" n;
- pr " %s =
guestfs_safe_malloc (g, sizeof (char *) * (len+1)
);\n"
+ pr " %s =
ALLOC_N (char *, len+1
);\n"
n;
pr " for (i = 0; i < len; ++i) {\n";
pr " VALUE v = rb_ary_entry (%sv, i);\n" n;