Browse Source

- bugfix, fixed memleak (strndup() already allocates RAM)

tags/v0.1.1-beta
andreas.romeyke@slub-dresden.de 4 years ago
parent
commit
814b40df77
1 changed files with 0 additions and 15 deletions
  1. +0
    -15
      src/helper/check_print.c

+ 0
- 15
src/helper/check_print.c View File

@@ -85,11 +85,6 @@ ret_t tif_rules_tag(tag_t tag, const char *msg) {
// rule
p++;
p->rm_type=rm_rule;
p->rm_msg = malloc( sizeof(char) *MAXSTRLEN );
if (NULL==p->rm_msg) {
fprintf(stderr, "could not allocate memory for 4tif_fails\n");
exit(EXIT_FAILURE);
};
p->rm_msg = strndup( msg, MAXSTRLEN);
printf( "%s", renderer( res) );
// free (str);
@@ -114,11 +109,6 @@ ret_t tif_rules(const char *msg) {
// rule
p++;
p->rm_type=rm_rule;
p->rm_msg = malloc( sizeof(char) *MAXSTRLEN );
if (NULL==p->rm_msg) {
fprintf(stderr, "could not allocate memory for 4tif_fails\n");
exit(EXIT_FAILURE);
};
p->rm_msg = strndup( msg, MAXSTRLEN);
printf( "%s", renderer( res) );
// free (str);
@@ -142,11 +132,6 @@ ret_t tif_files(const char *msg) {
// rule
p++;
p->rm_type=rm_file;
p->rm_msg = malloc( sizeof(char) *MAXSTRLEN );
if (NULL==p->rm_msg) {
fprintf(stderr, "could not allocate memory for 4tif_fails\n");
exit(EXIT_FAILURE);
};
p->rm_msg = strndup( msg, MAXSTRLEN);
printf( "%s", renderer( res) );
// free (str);


Loading…
Cancel
Save