Changeset 873 for branches


Ignore:
Timestamp:
Oct 4, 2006, 3:35:47 PM (13 years ago)
Author:
bruno
Message:

Patch from Andree tso that we create proper tmp var. to be used with getenv (avoids them to be freed later on)

File:
1 edited

Legend:

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

    r871 r873  
    975975    char *value = NULL;
    976976    char *tmp = NULL;
    977     char *tmp1 = NULL;
     977    char *envtmp1 = NULL;
     978    char *envtmp2 = NULL;
    978979    char *command = NULL;
    979980    char *iso_mnt = NULL;
     
    10471048            /* We need to override prefix value in PXE mode as it's
    10481049             * already done in start-nfs */
    1049             tmp = getenv("imgname");
    1050             if (tmp == NULL) {
     1050            envtmp1 = getenv("imgname");
     1051            if (envtmp1 == NULL) {
    10511052                fatal_error("no imgname variable in environment");
    10521053            }
    10531054            if (strstr(call_program_and_get_last_line_of_output
    10541055               ("cat /proc/cmdline"), "pxe")) {
    1055                     strcpy(bkpinfo->prefix,tmp);
     1056                    strcpy(bkpinfo->prefix,envtmp1);
    10561057            }
    10571058
     
    11651166        /* We need to override values in PXE mode as it's
    11661167         * already done in start-nfs */
    1167         tmp = getenv("nfsmount");
    1168         if (tmp == NULL) {
     1168        envtmp1 = getenv("nfsmount");
     1169        if (envtmp1 == NULL) {
    11691170            fatal_error("no nfsmount variable in environment");
    11701171        }
    1171         tmp1 = getenv("dirimg");
    1172         if (tmp1 == NULL) {
     1172        envtmp2 = getenv("dirimg");
     1173        if (envtmp2 == NULL) {
    11731174            fatal_error("no dirimg variable in environment");
    11741175        }
    11751176        if (strstr(call_program_and_get_last_line_of_output
    11761177           ("cat /proc/cmdline"), "pxe")) {
    1177                 strcpy(bkpinfo->nfs_mount,tmp);
    1178                 strcpy(bkpinfo->nfs_remote_dir,tmp1);
     1178                strcpy(bkpinfo->nfs_mount,envtmp1);
     1179                strcpy(bkpinfo->nfs_remote_dir,envtmp2);
    11791180            }
    11801181    } else if (bkpinfo->backup_media_type == iso) {
Note: See TracChangeset for help on using the changeset viewer.