Changeset 2301 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-tools.c
- Timestamp:
- Jul 23, 2009, 7:52:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-tools.c
r2296 r2301 30 30 31 31 extern int g_tape_buffer_size_MB; 32 extern char *g_serial_string;33 32 extern bool g_text_mode; 34 33 extern int g_currentY; … … 1376 1375 1377 1376 /** 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 /**1384 1377 * Allocate or free important globals, depending on @p mal. 1385 1378 * @param mal If TRUE, malloc; if FALSE, free. … … 1393 1386 malloc_string(g_tmpfs_mountpt); 1394 1387 */ 1395 malloc_string(g_serial_string);1396 1388 malloc_string(g_magicdev_command); 1397 1389 } else { … … 1401 1393 paranoid_free(g_tmpfs_mountpt); 1402 1394 */ 1403 paranoid_free(g_serial_string);1395 mr_free(g_serial_string); 1404 1396 paranoid_free(g_magicdev_command); 1405 1397 1406 1398 } 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 else1427 {1428 if (*ppcurr)1429 {1430 free(*ppcurr);1431 }1432 }1433 }1434 log_msg(5, "Returning");1435 */1436 1399 } 1437 1400
Note:
See TracChangeset
for help on using the changeset viewer.