Copy all fields in copy constructor (wjp and valgrind)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3775
This commit is contained in:
parent
4907599222
commit
0540ecdca5
1 changed files with 2 additions and 0 deletions
|
@ -97,6 +97,7 @@ DOS_File::DOS_File(const DOS_File& orig) {
|
|||
attr=orig.attr;
|
||||
refCtr=orig.refCtr;
|
||||
open=orig.open;
|
||||
hdrive=orig.hdrive;
|
||||
name=0;
|
||||
if(orig.name) {
|
||||
name=new char [strlen(orig.name) + 1];strcpy(name,orig.name);
|
||||
|
@ -110,6 +111,7 @@ DOS_File & DOS_File::operator= (const DOS_File & orig) {
|
|||
attr=orig.attr;
|
||||
refCtr=orig.refCtr;
|
||||
open=orig.open;
|
||||
hdrive=orig.hdrive;
|
||||
if(name) {
|
||||
delete [] name; name=0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue