diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-03-15 15:00:58 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-03-15 15:00:58 +0000 |
commit | cf26ef818e918c8c32658399e8aa9e31289109a7 (patch) | |
tree | 8f3782bc65cd4aef02b5b67566d27a0a39991a9d /generator | |
parent | c50ed37b71a50b2570a3b16a82a9d73e026be739 (diff) | |
download | libguestfs-cf26ef818e918c8c32658399e8aa9e31289109a7.tar.gz libguestfs-cf26ef818e918c8c32658399e8aa9e31289109a7.tar.xz libguestfs-cf26ef818e918c8c32658399e8aa9e31289109a7.zip |
ruby: Use ALLOC_N to avoid potential memory leak (RHBZ#667610).
Diffstat (limited to 'generator')
-rw-r--r-- | generator/generator_ruby.ml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generator/generator_ruby.ml b/generator/generator_ruby.ml index 8be93694..84d10e00 100644 --- 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; |