-rw-r--r-- | noncore/apps/opie-reader/Bkmks.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/Excel.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 45 |
3 files changed, 27 insertions, 23 deletions
diff --git a/noncore/apps/opie-reader/Bkmks.cpp b/noncore/apps/opie-reader/Bkmks.cpp index 00141a3..45aa045 100644 --- a/noncore/apps/opie-reader/Bkmks.cpp +++ b/noncore/apps/opie-reader/Bkmks.cpp @@ -345,2 +345,3 @@ Bkmk* BkmkFile::read05(BkmkFile* /*_this*/, FILE* f) b = new Bkmk(nm,anno,pos); + delete [] anno; } diff --git a/noncore/apps/opie-sheet/Excel.cpp b/noncore/apps/opie-sheet/Excel.cpp index 51fe707..27080e9 100644 --- a/noncore/apps/opie-sheet/Excel.cpp +++ b/noncore/apps/opie-sheet/Excel.cpp @@ -379,3 +379,5 @@ char* ExcelBook::GetDataOfBREC(ExcelBREC* record) { - ConvertCharToArray(record,Read(record->position,record->length),record->length); + char* readData = Read(record->position,record->length); + ConvertCharToArray(record,readData,record->length); + delete [] readData; }; diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index f70f863..9c0c6ce 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp @@ -1774,4 +1774,6 @@ int ZSafe::loadInit(const char* _filename, const char *password) - if (fd == NULL) + if (fd == NULL) { + delete krc2; return PWERR_OPEN; + } @@ -1790,4 +1792,6 @@ int ZSafe::loadInit(const char* _filename, const char *password) - if (size < 8) + if (size < 8) { + delete krc2; return PWERR_DATA; + } @@ -1811,2 +1815,3 @@ int ZSafe::loadInit(const char* _filename, const char *password) if (count2 == 0) { + delete krc2; return PWERR_DATA; @@ -1831,2 +1836,3 @@ int ZSafe::loadInit(const char* _filename, const char *password) } /* while ((count = read (fileno (fd), (unsigned char *) charbuf, 8)) > 0) */ + delete krc2; size -= buffer[size - 1]; @@ -2101,17 +2107,2 @@ int ZSafe::saveInit(const char *_filename, const char *password) - /* first we should check the permissions of the filename */ -/* - if (QFile::exists(_filename)) { - val = checkFile(_filename); - if (val != PWERR_GOOD) - return val; - } else - { - val = creat (_filename, (S_IRUSR | S_IWUSR)); - if (val == -1) - return PWERR_OPEN; - else - close(val); - } -*/ QFileInfo f (_filename); @@ -2121,4 +2112,6 @@ int ZSafe::saveInit(const char *_filename, const char *password) fd = fopen (_filename, "wb"); - if (fd == NULL) + if (fd == NULL) { + delete krc2; return PWERR_OPEN; + } @@ -2132,2 +2125,3 @@ int ZSafe::saveInit(const char *_filename, const char *password) krc2->rc2_expandkey (key, keylength, 128); + delete krc2; @@ -2190,4 +2184,10 @@ int ZSafe::saveEntry(char *entry[FIELD_SIZE]) bufferIndex = 0; - if (putc ((unsigned char) (ciphertext[count3] >> 8), fd) == EOF) return PWERR_DATA; - if (putc ((unsigned char) (ciphertext[count3] & 0xff), fd) == EOF) return PWERR_DATA; + if (putc ((unsigned char) (ciphertext[count3] >> 8), fd) == EOF) { + delete krc2; + return PWERR_DATA; + } + if (putc ((unsigned char) (ciphertext[count3] & 0xff), fd) == EOF) { + delete krc2; + return PWERR_DATA; + } } /*for (count3 = 0; count3 < 5; count3++)*/ @@ -2197,4 +2197,4 @@ int ZSafe::saveEntry(char *entry[FIELD_SIZE]) } /*while (count2 < strlen (buffer))*/ - int ret = PWERR_GOOD; - return ret; + delete krc2; + return PWERR_GOOD; } @@ -2230,2 +2230,3 @@ int ZSafe::saveFinalize(void) free(buffer); + delete krc2; return retval; |