File: readstat-1.1.9.patch

package info (click to toggle)
labplot 2.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,500 kB
  • sloc: cpp: 241,048; ansic: 6,324; python: 915; xml: 400; yacc: 237; sh: 221; awk: 35; makefile: 11
file content (27 lines) | stat: -rw-r--r-- 715 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff -ruNa a/src/bin/readstat.c b/src/bin/readstat.c
--- a/src/bin/readstat.c	2023-02-20 20:09:24.000000000 +0100
+++ b/src/bin/readstat.c	2024-02-02 17:41:51.463409738 +0100
@@ -397,8 +397,6 @@
         module->finish(rs_ctx->module_ctx);
     }
 
-    free(rs_ctx);
-
     if (error != READSTAT_OK) {
         if (file_exists) {
             fprintf(stderr, "Error opening %s: File exists (Use -f to overwrite)\n", output_filename);
@@ -406,9 +404,14 @@
             fprintf(stderr, "Error processing %s: %s\n", rs_ctx->error_filename, readstat_error_message(error));
             unlink(output_filename);
         }
+
+        free(rs_ctx);
+
         return 1;
     }
 
+    free(rs_ctx);
+
     return 0;
 }