Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong result of deleting and destroy #1

Open
Maxing1997 opened this issue May 21, 2021 · 0 comments
Open

wrong result of deleting and destroy #1

Maxing1997 opened this issue May 21, 2021 · 0 comments

Comments

@Maxing1997
Copy link

Maxing1997 commented May 21, 2021

here is my examples

$ ./a.out 
89 48 63 2 5 28 6 

Option
1. Insert
2. Delete
3. Destroy
--------------------
What do you want? : 2
Data : 48
21881 48 63 2 5 28 

Option
1. Insert
2. Delete
3. Destroy
--------------------
What do you want? : 3
double free or corruption (out)

You can see when delete 48, 48 is still here!!! In fact, the data to delete seems always to be the last one in array by reading the source code, so I suggest remove the data option in delete. And also the random value is caused by read unintialized value.

Also, the destroy operation also can't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant