Ignore:
Timestamp:
Jun 29, 2009, 7:19:14 PM (15 years ago)
Author:
Bruno Cornec
Message:

r3144@localhost: bruno | 2009-06-26 12:18:08 +0200

  • Remove mr_string.c|.h useless and in de=uplication with mr_str.c|.h
  • Solve with valgrind's help some memroy leak (harmless mostly)
  • Solve a seg fault at end, when unallocating a bkpinfo member after the strcuture disallocation !
  • after mr_strtok, memory ssociated with the token needs to be free
  • Adds a new function free_newt_stuff to free newt related allocated memory
  • Do not exit if mr_free is unsuccessful, and only warn when debug > 8
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mondo/src/common/libmondo-archive.c

    r2230 r2241  
    541541
    542542    assert(bkpinfo != NULL);
    543     malloc_string(last_filelist_number);
    544 
    545543    mr_asprintf(&tmp,
    546544            "echo '%s' | tr -s ' ' '\n' | grep -E '^/dev/.*$' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'",
     
    20352033    char *tmp = NULL;
    20362034    char *bigfile_fname;
    2037     char *sz_devfile;
     2035    char *sz_devfile = NULL;
    20382036    char *ntfsprog_fifo = NULL;
    20392037    /*@ long *********************************************** */
     
    20552053
    20562054    malloc_string(bigfile_fname);
    2057     malloc_string(sz_devfile);
    20582055    estimated_total_noof_slices =
    20592056        size_of_all_biggiefiles_K() / bkpinfo->optimal_set_size + 1;
     
    21112108                        "Calling ntfsclone in background because %s is an NTFS partition",
    21122109                        bigfile_fname);
    2113                 sprintf(sz_devfile, "%s/%d.%d.000",
     2110                mr_asprintf(&sz_devfile, "%s/%d.%d.000",
    21142111                        bkpinfo->tmpdir,
    21152112                        (int) (random() % 32768),
     
    21192116                switch (pid = fork()) {
    21202117                case -1:
     2118                    mr_free(sz_devfile);
    21212119                    fatal_error("Fork failure");
    21222120                case 0:
     
    21252123                            bigfile_fname, sz_devfile);
    21262124                    res = feed_into_ntfsprog(bigfile_fname, sz_devfile);
     2125                    /* BCO/BERLIOS Does the child need to unalocate memory as well ?
     2126                    paranoid_free(bigfile_fname);
     2127                    mr_free(sz_devfile);
     2128                    */
    21272129                    exit(res);
    21282130                    break;
     
    21312133                            "feed_into_ntfsprog() called in background --- pid=%ld",
    21322134                            (long int) (pid));
     2135                    mr_free(sz_devfile);
    21332136                }
    21342137            }
    21352138            // Otherwise, use good old 'dd' and 'bzip2'
    21362139            else {
    2137                 sz_devfile[0] = '\0';
    21382140                ntfsprog_fifo = NULL;
    21392141            }
     
    21882190    paranoid_fclose(fin);
    21892191    paranoid_free(bigfile_fname);
    2190     paranoid_free(sz_devfile);
    21912192    return (retval);
    21922193}
Note: See TracChangeset for help on using the changeset viewer.