Changeset 1390


Ignore:
Timestamp:
May 3, 2007, 2:03:17 AM (12 years ago)
Author:
bruno
Message:

Attempt to solve mr_cleanup multiple call while struct mr_cnf not initialized

Location:
branches/stable/mondo/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/lib/mr_err.c

    r1269 r1390  
    1717#include <stdlib.h>
    1818
    19 #include "mr_msg.h"
    20 
    2119/* Pointer to the right cleanup function provided by each main */
    2220extern void (*mr_cleanup)(void);
  • 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.