Ignore:
Timestamp:
Dec 1, 2005, 10:00:14 AM (14 years ago)
Author:
bcornec
Message:

MONDO_LOGFILE used each time now
memory management on libmondo-devices.c
some splint improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/common/libmondo-stream.c

    r127 r146  
    209209 * this platform, then the IDE tape, then "/dev/st0", then "/dev/osst0".
    210210 * @param dev Where to put the found tape device.
    211  * @param siz Where to put the tape size (a string like "4GB")
     211 * @param siz Where to put the tape size (a string like "4GB"). Should be freed by caller
    212212 * @return 0 if success, nonzero if failure (in which @p dev and @p siz are undefined).
    213213 */
     
    220220
    221221    log_to_screen("I am looking for your tape streamer. Please wait.");
    222     dev[0] = siz[0] = '\0';
     222    dev[0] = '\0';
     223    siz = NULL;
    223224    if (find_home_of_exe("cdrecord")) {
    224225        asprintf(&cdr_exe, "cdrecord");
     
    235236            ("Either too few or too many tape streamers for me to detect...");
    236237        strcpy(dev, VANILLA_SCSI_TAPE);
     238        paranoid_free(tmp);
     239        paranoid_free(cdr_exe);
    237240        return 1;
    238241    }
     
    246249    if (strlen(tmp) < 2) {
    247250        log_it("Could not find tape device");
     251        paranoid_free(tmp);
     252        paranoid_free(cdr_exe);
    248253        return 1;
    249254    }
     
    303308    }
    304309
    305     siz[0] = '\0';
    306310    log_it("res=%d; dev=%s", res, dev);
    307311
    308312    if (res) {
     313        paranoid_free(tmp);
    309314        return (res);
    310315    }
    311316
    312317    if (strlen(tmp) < 2) {
    313         siz[0] = '\0';
    314318        log_it("Warning - size of tape unknown");
     319        paranoid_free(tmp);
    315320        return (0);
    316321    } else {
    317         strcpy(siz, tmp);
     322        siz = tmp;
    318323        return (0);
    319324    }
    320     paranoid_free(tmp);
    321325}
    322326
Note: See TracChangeset for help on using the changeset viewer.