Questions tagged [double-free]

94 questions
-2
votes
2 answers

Double free or corruption, why does this appear?

I've nearly finished my smart pointer (I know...) so I uploaded it to my univerity's website which runs a number of automated tests on my code. There are two things wrong with a number of tests: Memory or time limit is exceeded Memory access…
masm64
  • 1,222
  • 3
  • 14
  • 31
-3
votes
1 answer

Why is my overloaded assignment operator is not being invoked on initialization?

I created a test class to demonstrate the use of the overloaded assignment operator, and the pitfalls associated with double freeing memory. The code for this class is below: class Test { public: Test() : ptr{new int(0)}, val{0}, id{count++}…
Galaxy
  • 2,363
  • 2
  • 25
  • 59
-6
votes
1 answer

invalid next size and double free error

I have here some very simple lines of code but they are giving me some serious error messages. 1.My code: #include using namespace std; void solve( int n, unsigned long long k, int x){ unsigned long long divi =…
-6
votes
1 answer

deallocation and memory allocation problems in FORTRAN

I am having problems with the deallocate and allocate aspects of part of my FORTRAN code. in particular, i think that the issue has to do with memory allocation from a search on my error message on the web. The error message talks about invalid…
Jourdan Gold
  • 55
  • 1
  • 2
  • 10
1 2 3 4 5 6
7