Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/simpleini.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrodie Thiesfield <brofield@users.noreply.github.com>2015-10-12 23:23:01 +0300
committerBrodie Thiesfield <brofield@users.noreply.github.com>2015-10-12 23:23:01 +0300
commite850d4e1cae65ee10f60992c5a576dce7fe35220 (patch)
treed5e116aa22cdae0b6549b3a773778993e3b264cd
parent6537e69498d400b299af7ac80e9c966ff867cd53 (diff)
parent0daa6a72f316e0ec8c9ec7c85cc2a2b2a685b40c (diff)
Merge pull request #17 from vladon/master
correct use of `new`
-rw-r--r--SimpleIni.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/SimpleIni.h b/SimpleIni.h
index 5fcd2ee..aee5bee 100644
--- a/SimpleIni.h
+++ b/SimpleIni.h
@@ -1387,7 +1387,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::LoadFile(
}
// allocate and ensure NULL terminated
- char * pData = new char[lSize+1];
+ char * pData = new(std::nothrow) char[lSize+1];
if (!pData) {
return SI_NOMEM;
}
@@ -1436,7 +1436,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::LoadData(
// allocate memory for the data, ensure that there is a NULL
// terminator wherever the converted data ends
- SI_CHAR * pData = new SI_CHAR[uLen+1];
+ SI_CHAR * pData = new(std::nothrow) SI_CHAR[uLen+1];
if (!pData) {
return SI_NOMEM;
}
@@ -1861,7 +1861,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::CopyString(
for ( ; a_pString[uLen]; ++uLen) /*loop*/ ;
}
++uLen; // NULL character
- SI_CHAR * pCopy = new SI_CHAR[uLen];
+ SI_CHAR * pCopy = new(std::nothrow) SI_CHAR[uLen];
if (!pCopy) {
return SI_NOMEM;
}