Ignore:
Timestamp:
May 3, 2007, 2:03:17 AM (13 years ago)
Author:
Bruno Cornec
Message:

Attempt to solve mr_cleanup multiple call while struct mr_cnf not initialized

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondoarchive/mondoarchive.c

    r1384 r1390  
    195195void (*mr_cleanup)(void) = NULL;
    196196
     197/* Just for init */
     198void mr_ar_cleanup_empty(void) {
     199}
     200
    197201/* Cleanup all memory allocated in various structures */
    198202void mr_ar_cleanup(void) {
     
    232236    printf(_("Initializing..."));
    233237
    234     /* Reference the right cleanup function for mr_exit */
    235     mr_cleanup = &mr_ar_cleanup;
     238    /* Reference a dummy cleanup function for mr_exit temporarily */
     239    mr_cleanup = &mr_ar_cleanup_empty;
    236240
    237241    /* initialize log file with time stamp */
     
    262266    }
    263267    mr_ar_store_conf(&mr_conf);
     268    /* Reference the right cleanup function for mr_exit now it's allocated */
     269    mr_cleanup = &mr_ar_cleanup;
     270
    264271    mr_conf_close();
    265272
Note: See TracChangeset for help on using the changeset viewer.