Skip to content
Snippets Groups Projects
Unverified Commit fbc6fff6 authored by Guilherme Amadio's avatar Guilherme Amadio
Browse files

Use strdup() to copy string in THostAuth

parent 922f6bae
No related branches found
No related tags found
No related merge requests found
...@@ -196,9 +196,7 @@ THostAuth::THostAuth(const char *asstring) : TObject() ...@@ -196,9 +196,7 @@ THostAuth::THostAuth(const char *asstring) : TObject()
fServer = -1; fServer = -1;
TString strtmp(asstring); TString strtmp(asstring);
char *tmp = new char[strlen(asstring)+1]; char *tmp = strdup(asstring);
strncpy(tmp,asstring,strlen(asstring));
tmp[strlen(asstring)] = 0;
fHost = TString((const char *)strtok(tmp," ")); fHost = TString((const char *)strtok(tmp," "));
strtmp.ReplaceAll(fHost,""); strtmp.ReplaceAll(fHost,"");
...@@ -213,7 +211,7 @@ THostAuth::THostAuth(const char *asstring) : TObject() ...@@ -213,7 +211,7 @@ THostAuth::THostAuth(const char *asstring) : TObject()
strtmp.ReplaceAll(fNmet,""); strtmp.ReplaceAll(fNmet,"");
fNmet.Remove(0,fNmet.Index(":")+1); fNmet.Remove(0,fNmet.Index(":")+1);
delete[] tmp; free(tmp);
fNumMethods = atoi(fNmet.Data()); fNumMethods = atoi(fNmet.Data());
Int_t i = 0; Int_t i = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment