diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-03-16 01:22:43 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2022-03-16 01:22:43 +0000 |
commit | 93055cbd559056f3bded65107d1fe8f2b7baaa1b (patch) | |
tree | ab24fbfc5cf720b92a62d57f967c9b41d7d6a564 /converter/other | |
parent | fb3a32cc9d97d2c29361f76a48c034d5aca30920 (diff) | |
download | netpbm-mirror-93055cbd559056f3bded65107d1fe8f2b7baaa1b.tar.gz netpbm-mirror-93055cbd559056f3bded65107d1fe8f2b7baaa1b.tar.xz netpbm-mirror-93055cbd559056f3bded65107d1fe8f2b7baaa1b.zip |
Fix use after free from recent commit
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4310 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other')
-rw-r--r-- | converter/other/ipdb.c | 16 | ||||
-rw-r--r-- | converter/other/ipdb.h | 3 | ||||
-rw-r--r-- | converter/other/pdbimgtopam.c | 2 |
3 files changed, 6 insertions, 15 deletions
diff --git a/converter/other/ipdb.c b/converter/other/ipdb.c index 477a9264..d524c7e9 100644 --- a/converter/other/ipdb.c +++ b/converter/other/ipdb.c @@ -164,21 +164,17 @@ ipdb_pdbheadFree(PDBHEAD * const headP) { void -ipdb_clear(IPDB * const pdbP) { +ipdb_free(IPDB * const pdbP) { - if (pdbP) { + if (pdbP->i) ipdb_imageFree(pdbP->i); - ipdb_textFree(pdbP->t); - ipdb_pdbheadFree(pdbP->p); - } -} - + if (pdbP->t) + ipdb_textFree(pdbP->t); -void -ipdb_free(IPDB * const pdbP) { + if (pdbP->p) + ipdb_pdbheadFree(pdbP->p); - ipdb_clear(pdbP); free(pdbP); } diff --git a/converter/other/ipdb.h b/converter/other/ipdb.h index 013fa441..59e5d266 100644 --- a/converter/other/ipdb.h +++ b/converter/other/ipdb.h @@ -216,9 +216,6 @@ ipdb_free(IPDB *); IPDB * ipdb_alloc(void); -void -ipdb_clear(IPDB * const pdbP); - PDBHEAD * ipdb_pdbheadAlloc(void); diff --git a/converter/other/pdbimgtopam.c b/converter/other/pdbimgtopam.c index 5c0f1094..b191644f 100644 --- a/converter/other/pdbimgtopam.c +++ b/converter/other/pdbimgtopam.c @@ -533,8 +533,6 @@ ipdbRead(IPDB * const pdbP, int status; - ipdb_clear(pdbP); - status = pdbheadRead(pdbP->p, fileP); if (status != 0) |