diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2017-10-04 19:04:30 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2017-10-04 19:04:30 (GMT) |
commit | 9e5f8092376f13a970812e24e82c106d7dfc7869 (patch) | |
tree | 79ce58851a8f12617ff5a2f5bd2cd92b51d2d08b /tksao/fitsy++ | |
parent | 6efa7b442cc46ecd46a2b8d0dce33f1cb3974d5b (diff) | |
download | blt-9e5f8092376f13a970812e24e82c106d7dfc7869.zip blt-9e5f8092376f13a970812e24e82c106d7dfc7869.tar.gz blt-9e5f8092376f13a970812e24e82c106d7dfc7869.tar.bz2 |
track down memory leaks with getString
Diffstat (limited to 'tksao/fitsy++')
-rw-r--r-- | tksao/fitsy++/card.C | 10 | ||||
-rw-r--r-- | tksao/fitsy++/card.h | 3 | ||||
-rw-r--r-- | tksao/fitsy++/file.C | 14 | ||||
-rw-r--r-- | tksao/fitsy++/file.h | 1 | ||||
-rw-r--r-- | tksao/fitsy++/head.C | 13 | ||||
-rw-r--r-- | tksao/fitsy++/head.h | 1 |
6 files changed, 3 insertions, 39 deletions
diff --git a/tksao/fitsy++/card.C b/tksao/fitsy++/card.C index e10b807..9f31c73 100644 --- a/tksao/fitsy++/card.C +++ b/tksao/fitsy++/card.C @@ -235,14 +235,6 @@ char* FitsCard::getString() return buf_; } -char* FitsCard::getStringCopy() -{ - getString(); - char* cpy = new char[strlen(buf_)+1]; - strcpy(cpy, buf_); - return cpy; -} - char* FitsCard::getComment() { char* cpy = new char[FTY_CARDLEN-7]; @@ -252,7 +244,7 @@ char* FitsCard::getComment() return cpy; } -char* FitsCard::getAsString() +char* FitsCard::getKeyword() { char value[FTY_CARDLEN]; value[0] = '\0'; diff --git a/tksao/fitsy++/card.h b/tksao/fitsy++/card.h index 393ed8a..cd855ea 100644 --- a/tksao/fitsy++/card.h +++ b/tksao/fitsy++/card.h @@ -64,9 +64,8 @@ public: double getReal(); void getComplex(double*, double*); char* getString(); - char* getStringCopy(); char* getComment(); - char* getAsString(); + char* getKeyword(); }; #endif diff --git a/tksao/fitsy++/file.C b/tksao/fitsy++/file.C index 059854d..74e9032 100644 --- a/tksao/fitsy++/file.C +++ b/tksao/fitsy++/file.C @@ -485,20 +485,6 @@ char* FitsFile::getString(const char* name) return NULL; } -char* FitsFile::getStringCopy(const char* name) -{ - if (head_) { - char* r = head_->getStringCopy(name); - if (r) - return r; - else - if (primary_ && inherit_) - return primary_->getStringCopy(name); - } - - return NULL; -} - char* FitsFile::getComment(const char* name) { if (head_) { diff --git a/tksao/fitsy++/file.h b/tksao/fitsy++/file.h index a665fee..e410d92 100644 --- a/tksao/fitsy++/file.h +++ b/tksao/fitsy++/file.h @@ -213,7 +213,6 @@ public: void getComplex(const char* name, double* real, double* img, double rdef, double idef); char* getString(const char* name); - char* getStringCopy(const char* name); char* getComment(const char* name); char* getKeyword(const char* name); diff --git a/tksao/fitsy++/head.C b/tksao/fitsy++/head.C index e6722db..7882f1a 100644 --- a/tksao/fitsy++/head.C +++ b/tksao/fitsy++/head.C @@ -327,17 +327,6 @@ char* FitsHead::getString(const char* name) return NULL; } -char* FitsHead::getStringCopy(const char* name) -{ - char* card = find(name); - if (card) { - FitsCard c(card); - return c.getStringCopy(); - } - else - return NULL; -} - char* FitsHead::getComment(const char* name) { char* card = find(name); @@ -354,7 +343,7 @@ char* FitsHead::getKeyword(const char* name) char* card = find(name); if (card) { FitsCard c(card); - return c.getAsString(); + return c.getKeyword(); } else return NULL; diff --git a/tksao/fitsy++/head.h b/tksao/fitsy++/head.h index 6c91323..ad61a2a 100644 --- a/tksao/fitsy++/head.h +++ b/tksao/fitsy++/head.h @@ -122,7 +122,6 @@ public: void getComplex(const char* name, double* real, double* img, double rdef, double idef); char* getString(const char* name); - char* getStringCopy(const char* name); char* getComment(const char* name); char* getKeyword(const char* name); |