Ignore:
Timestamp:
Jul 17, 2006, 7:43:58 PM (18 years ago)
Author:
bcornec
Message:

Still other memory management improvements ( I hope :-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c

    r688 r689  
    659659        asprintf(&p1, "-o ro");
    660660    }
    661     if (find_home_of_exe("setfattr")) {
     661    tmp = find_home_of_exe("setfattr");
     662    if (tmp) {
    662663        asprintf(&p2, ",user_xattr");
    663664    } else {
    664665        asprintf(&p2, "");
    665666    }
    666     if (find_home_of_exe("setfacl")) {
     667    paranoid_free(tmp);
     668
     669    tmp = find_home_of_exe("setfacl");
     670    if (tmp) {
    667671        asprintf(&p3, ",acl");
    668672    } else {
    669673        asprintf(&p3, "");
    670674    }
     675    paranoid_free(tmp);
     676
    671677    asprintf(&additional_parameters, "%s%s%s", p1, p2, p3);
    672678    paranoid_free(p1);
     
    13741380{
    13751381    char *output = NULL;
     1382    char *tmp = NULL;
    13761383
    13771384    /* BERLIOS: This should use $EDITOR + conf file rather first */
    1378     if (find_home_of_exe("pico")) {
     1385    tmp = find_home_of_exe("pico");
     1386    if (tmp) {
    13791387        asprintf(&output, "pico");
    1380     } else if (find_home_of_exe("nano")) {
    1381         asprintf(&output, "nano");
    1382     } else if (find_home_of_exe("e3em")) {
    1383         asprintf(&output, "e3em");
    1384     } else if (find_home_of_exe("e3vi")) {
    1385         asprintf(&output, "e3vi");
    1386     } else {
    1387         asprintf(&output, "vi");
    1388     }
    1389     if (!find_home_of_exe(output)) {
     1388    } else {
     1389        tmp = find_home_of_exe("nano");
     1390        if (tmp) {
     1391            asprintf(&output, "nano");
     1392        } else {
     1393            tmp = find_home_of_exe("vi");
     1394            if (tmp) {
     1395                asprintf(&output, "vi");
     1396            } else {
     1397                asprintf(&output, "emacs");
     1398            }
     1399        }
     1400    }
     1401    paranoid_free(tmp);
     1402
     1403    tmp = find_home_of_exe(output);
     1404    if (!tmp) {
    13901405        log_msg(2, " (find_my_editor) --- warning - %s not found", output);
    13911406    }
     1407    paranoid_free(tmp);
    13921408    return (output);
    13931409}
Note: See TracChangeset for help on using the changeset viewer.