This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Plug more memory leaks in vms.c.
authorCraig A. Berry <craigberry@mac.com>
Sat, 3 Jul 2010 00:04:35 +0000 (19:04 -0500)
committerCraig A. Berry <craigberry@mac.com>
Sat, 3 Jul 2010 00:07:16 +0000 (19:07 -0500)
In Perl_rename() we were allocating the same thing twice.

In vms_fid_to_name() (used by realpath() and realname()), we had
another flagrant omission of freeing local storage.

vms/vms.c

index e98c015..db686d2 100644 (file)
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -5341,10 +5341,6 @@ Stat_t dst_st;
           }
 
            /* The source must be a file specification */
-           vms_dir_file = PerlMem_malloc(VMS_MAXRSS);
-           if (vms_dir_file == NULL)
-               _ckvmssts_noperl(SS$_INSFMEM);
-
            ret_str = do_fileify_dirspec(vms_dst, vms_dir_file, 0, NULL);
            if (ret_str == NULL) {
                PerlMem_free(vms_dst);
@@ -14232,9 +14228,10 @@ struct statbuf_t {
             if (mode) {
                 *mode = statbuf.old_st_mode;
             }
-           return 0;
        }
     }
+    PerlMem_free(temp_fspec);
+    PerlMem_free(fileified);
     return sts;
 }