OSDN Git Service
(root)
/
openpts
/
openpts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
deleted ASSERTs and added many checks, also cleanup the codes
[openpts/openpts.git]
/
src
/
ctx.c
diff --git
a/src/ctx.c
b/src/ctx.c
index
d65a2ba
..
f127dc6
100644
(file)
--- a/
src/ctx.c
+++ b/
src/ctx.c
@@
-125,22
+125,32
@@
int freePtsContext(OPENPTS_CONTEXT *ctx) {
}
/* IML - reset & free */
}
/* IML - reset & free */
- freeSnapshotTable(ctx->ss_table);
+ if (ctx->ss_table != NULL) {
+ freeSnapshotTable(ctx->ss_table);
+ }
/* Properties - free */
freePropertyChain(ctx->prop_start);
/* Policy - free */
/* Properties - free */
freePropertyChain(ctx->prop_start);
/* Policy - free */
- freePolicyChain(ctx->policy_start);
+ if (ctx->policy_start != NULL) {
+ freePolicyChain(ctx->policy_start);
+ }
/* Reason - free */
/* Reason - free */
- freeReasonChain(ctx->reason_start);
+ if (ctx->reason_start != NULL) {
+ freeReasonChain(ctx->reason_start);
+ }
/* RM - free malloc at rm.c */
/* RM - free malloc at rm.c */
- freeRmContext(ctx->rm_ctx);
+ if (ctx->rm_ctx != NULL) {
+ freeRmContext(ctx->rm_ctx);
+ }
/* IR - free, malloc at ir.c */
/* IR - free, malloc at ir.c */
- freeIrContext(ctx->ir_ctx);
+ if (ctx->ir_ctx != NULL) {
+ freeIrContext(ctx->ir_ctx);
+ }
/* Runtime Validation - free */
/* Runtime Validation - free */