Skip to content

Commit

Permalink
[XrdOfs] Make sure TPC prog is not a dangling ptr.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichal committed Jun 27, 2018
1 parent 5b194b8 commit d0a7cab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/XrdOfs/XrdOfsConfig.cc
Expand Up @@ -1377,7 +1377,7 @@ int XrdOfs::xtpc(XrdOucStream &Config, XrdSysError &Eroute)
{Eroute.Emsg("Config", "tpc command line too long"); return 1;}
if (!*pgm)
{Eroute.Emsg("Config", "tpc program not specified"); return 1;}
Parms.Pgm = pgm;
Parms.Pgm = strdup( pgm );
break;
}
if (!strcmp(val, "require"))
Expand Down
3 changes: 2 additions & 1 deletion src/XrdOfs/XrdOfsTPC.cc
Expand Up @@ -417,7 +417,8 @@ void XrdOfsTPC::Init(XrdOfsTPC::iParm &Parms)
//
if (Parms.Pgm)
{if (XfrProg) free(XfrProg);
XfrProg = strdup(Parms.Pgm);
XfrProg = Parms.Pgm;
Parms.Pgm = 0;
}

// Set checksum type if specified
Expand Down

0 comments on commit d0a7cab

Please sign in to comment.