]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Redo a mis-fix of a memory leak in r9919: I added sfree(data)
authorSimon Tatham <anakin@pobox.com>
Sat, 20 Jul 2013 13:15:10 +0000 (13:15 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 20 Jul 2013 13:15:10 +0000 (13:15 +0000)
immediately after conf_deserialise in the Duplicate Session receiver,
whereas I should have put it after the subsequent loop that extracts
the pty argv if any.

[originally from svn r9943]
[r9919 == ea301bdd9b892a5e70692f82f5c0b98bd585e775]

unix/gtkwin.c

index ad8ade52c8b69310ca9ac4e7bf84682dd1ecbaa1..667c72b3076f118140bc4b8a4bb8407bc8cb2546 100644 (file)
@@ -3344,7 +3344,6 @@ int read_dupsession_data(struct gui_data *inst, Conf *conf, char *arg)
     }
 
     size_used = conf_deserialise(conf, data, size);
-    sfree(data);
     if (use_pty_argv && size > size_used) {
        int n = 0;
        i = size_used;
@@ -3371,6 +3370,8 @@ int read_dupsession_data(struct gui_data *inst, Conf *conf, char *arg)
        }
     }
 
+    sfree(data);
+
     return 0;
 }