diff options
author | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-06-27 20:25:29 +0000 |
---|---|---|
committer | ben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2002-06-27 20:25:29 +0000 |
commit | 0663475e9f7517fd444acafe24992fb549fafc86 (patch) | |
tree | 156200ffeb92584a3b31e8cdb8527feb1fc07ce4 /rdiff-backup | |
parent | 47d557924d91f6003ebbecb29bb29ffec02c1f07 (diff) | |
download | rdiff-backup-0663475e9f7517fd444acafe24992fb549fafc86.tar.gz |
Check for a memory leak in librsync
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@154 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup')
-rw-r--r-- | rdiff-backup/rdiff_backup/memoryleak.c | 23 | ||||
-rw-r--r-- | rdiff-backup/src/memoryleak.c | 23 |
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); + } +} |