You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
598 B
36 lines
598 B
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
#include <stdlib.h>
|
|
|
|
int double_free_in_catch_bad_FN(int a[10], int b) {
|
|
try {
|
|
if (b > 0) {
|
|
free(a);
|
|
throw(0);
|
|
}
|
|
} catch (...) {
|
|
free(a);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
void throw_positive(int a[10], int b) {
|
|
if (b > 0) {
|
|
free(a);
|
|
throw(1);
|
|
}
|
|
}
|
|
|
|
int double_free_interproc_bad_FN(int a[10], int b) {
|
|
try {
|
|
throw_positive(a, 2);
|
|
} catch (...) {
|
|
free(a);
|
|
}
|
|
return 0;
|
|
}
|