Ignore:
Timestamp:
Jul 23, 2009, 7:52:12 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • g_serial_string is managed dynamically
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.10/mondo/src/common/libmondo-tools.c

    r2296 r2301  
    3030
    3131extern int g_tape_buffer_size_MB;
    32 extern char *g_serial_string;
    3332extern bool g_text_mode;
    3433extern int g_currentY;
     
    13761375
    13771376/**
    1378  * If @p y, malloc @p x, else free @p x.
    1379  * @bug This function seems orphaned. Please remove.
    1380  */
    1381 #define do_alloc_or_free_depending(x,y) { if(y) {x=malloc(MAX_STR_LEN);} else {paranoid_free(x);} }
    1382 
    1383 /**
    13841377 * Allocate or free important globals, depending on @p mal.
    13851378 * @param mal If TRUE, malloc; if FALSE, free.
     
    13931386        malloc_string(g_tmpfs_mountpt);
    13941387        */
    1395         malloc_string(g_serial_string);
    13961388        malloc_string(g_magicdev_command);
    13971389    } else {
     
    14011393        paranoid_free(g_tmpfs_mountpt);
    14021394        */
    1403         paranoid_free(g_serial_string);
     1395        mr_free(g_serial_string);
    14041396        paranoid_free(g_magicdev_command);
    14051397
    14061398    }
    1407 
    1408     /*
    1409        char**list_of_arrays[] = {
    1410        &g_boot_mountpt,
    1411        &g_mondo_home,
    1412        &g_tmpfs_mountpt,
    1413        &g_serial_string,
    1414        &g_magicdev_command,
    1415        NULL};
    1416 
    1417        char**ppcurr;
    1418        int i;
    1419 
    1420        for(i=0;list_of_arrays[i];i++)
    1421        {
    1422        log_msg(5, "Allocating %d", i);
    1423        ppcurr = list_of_arrays[i];
    1424        if (mal)
    1425        { *ppcurr = malloc(MAX_STR_LEN); }
    1426        else
    1427        {
    1428        if (*ppcurr)
    1429        {
    1430        free(*ppcurr);
    1431        }
    1432        }
    1433        }
    1434        log_msg(5, "Returning");
    1435      */
    14361399}
    14371400
Note: See TracChangeset for help on using the changeset viewer.