summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rdiff-backup/rdiff_backup/memoryleak.c23
-rw-r--r--rdiff-backup/src/memoryleak.c23
2 files changed, 46 insertions, 0 deletions
diff --git a/rdiff-backup/rdiff_backup/memoryleak.c b/rdiff-backup/rdiff_backup/memoryleak.c
new file mode 100644
index 0000000..9fc698b
--- /dev/null
+++ b/rdiff-backup/rdiff_backup/memoryleak.c
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <rsync.h>
+
+main()
+{
+ FILE *basis_file, *sig_file;
+ char filename[50];
+ rs_stats_t stats;
+ rs_result result;
+ long i;
+
+ for(i=0; i<=100000; i++) {
+ basis_file = fopen("a", "r");
+ sig_file = fopen("sig", "w");
+
+ result = rs_sig_file(basis_file, sig_file,
+ RS_DEFAULT_BLOCK_LEN, RS_DEFAULT_STRONG_LEN,
+ &stats);
+ if (result != RS_DONE) exit(result);
+ fclose(basis_file);
+ fclose(sig_file);
+ }
+}
diff --git a/rdiff-backup/src/memoryleak.c b/rdiff-backup/src/memoryleak.c
new file mode 100644
index 0000000..9fc698b
--- /dev/null
+++ b/rdiff-backup/src/memoryleak.c
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <rsync.h>
+
+main()
+{
+ FILE *basis_file, *sig_file;
+ char filename[50];
+ rs_stats_t stats;
+ rs_result result;
+ long i;
+
+ for(i=0; i<=100000; i++) {
+ basis_file = fopen("a", "r");
+ sig_file = fopen("sig", "w");
+
+ result = rs_sig_file(basis_file, sig_file,
+ RS_DEFAULT_BLOCK_LEN, RS_DEFAULT_STRONG_LEN,
+ &stats);
+ if (result != RS_DONE) exit(result);
+ fclose(basis_file);
+ fclose(sig_file);
+ }
+}