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-cli.c

    r2229 r2241  
    1313#include "my-stuff.h"
    1414#include "mr_mem.h"
    15 #include "mr_string.h"
     15#include "mr_str.h"
    1616#include "mondostructures.h"
    1717#include "libmondo-cli-EXT.h"
     
    297297            log_msg (4, "Could not get the list of mounted file systems");
    298298            paranoid_free(mounted_file_system);
     299            mr_free(token);
    299300            return (1);
    300301        }
    301         log_msg (5, "token: %s", token);
     302        if (token) {
     303            log_msg (5, "token: %s", token);
     304        }
    302305        while (token != NULL) {
    303306            log_msg (5, "token: %s", token);
     
    307310            add_mounted_fs_struct(DSFptr);
    308311            strcpy(DSFptr->device, token);
     312            mr_free(token);
    309313            if ((token = strtok(NULL, token_chars)) == NULL) {
    310314                log_msg (5, "Ran out of entries on the mounted file systems list");
    311315                paranoid_free(mounted_file_system);
     316                mr_free(token);
    312317                return (1);
    313318            }
    314319            log_msg (5, "token: %s", token);
    315320            strcpy(DSFptr->mount_point, token);
     321            mr_free(token);
    316322            token = strtok(NULL, token_chars);
    317323        }
     
    410416        log_msg (5, "Found partition: %s", token);
    411417        strcpy(partitions[i++], token);
     418        mr_free(token);
    412419    }
    413420    paranoid_free(partition_list);
     
    507514                            log_msg (4, "Can't find mount point %s in mounted file systems list", token);
    508515                            paranoid_free(tmp);
     516                            mr_free(token);
    509517                            return (1);
    510518                        }
    511519                        DSFptr->check = 1;
     520                        mr_free(token);
    512521                    }
    513522                    /********
     
    535544                                log_msg (4, "Can't find device %s in mounted file systems list", token);
    536545                                paranoid_free(tmp);
     546                                mr_free(token);
    537547                                return (1);
    538548                            }
     
    540550                        }
    541551                    }
     552                    mr_free(token);
    542553                    paranoid_free(mount_list);
    543554                } else {
     
    588599                    log_msg (4, "Can't find device %s in mounted file systems list", token);
    589600                    paranoid_free(tmp);
     601                    mr_free(token);
    590602                    return (1);
    591603                }
     
    593605                break;
    594606            }
     607            mr_free(token);
    595608        }
    596609        paranoid_free(tmp);
     
    806819                break;
    807820            }
     821            mr_free(token);
    808822        }
    809823        log_msg(1, "include_paths is now '%s'", bkpinfo->include_paths);
     
    11371151                break;
    11381152            }
     1153            mr_free(token);
    11391154        }
    11401155        log_msg(1, "exclude_paths is now '%s'", bkpinfo->exclude_paths);
Note: See TracChangeset for help on using the changeset viewer.