diff --git a/src/include/kdberrors.h b/src/include/kdberrors.h index eacbae94daf..51a58f7a5af 100644 --- a/src/include/kdberrors.h +++ b/src/include/kdberrors.h @@ -55,7 +55,8 @@ using KeySet = ckdb::KeySet; do \ { \ ELEKTRA_LOG ("Add Error %s", ELEKTRA_ERROR_OUT_OF_MEMORY); \ - elektraSetErrorOUT_OF_MEMORY (key, __FILE__, ELEKTRA_STRINGIFY (__LINE__), ELEKTRA_STRINGIFY (ELEKTRA_MODULE_NAME)); \ + elektraSetErrorOUT_OF_MEMORY (key, __FILE__, ELEKTRA_STRINGIFY (__LINE__), ELEKTRA_STRINGIFY (ELEKTRA_MODULE_NAME), \ + "Memory allocation failed"); \ } while (0) #define ELEKTRA_ADD_OUT_OF_MEMORY_WARNING(key, reason) \ diff --git a/src/libs/elektra/errors.c b/src/libs/elektra/errors.c index 302bfcf6584..06e6d03f145 100644 --- a/src/libs/elektra/errors.c +++ b/src/libs/elektra/errors.c @@ -139,6 +139,7 @@ static void setError (Key * key, const char * code, const char * name, const cha } DEFINE_ERROR_AND_WARNING (RESOURCE) +DEFINE_ERROR_AND_WARNING (OUT_OF_MEMORY) DEFINE_ERROR_AND_WARNING (INSTALLATION) DEFINE_ERROR_AND_WARNING (INTERNAL) DEFINE_ERROR_AND_WARNING (INTERFACE) @@ -147,11 +148,6 @@ DEFINE_ERROR_AND_WARNING (CONFLICTING_STATE) DEFINE_ERROR_AND_WARNING (VALIDATION_SYNTACTIC) DEFINE_ERROR_AND_WARNING (VALIDATION_SEMANTIC) -void elektraSetErrorOUT_OF_MEMORY (Key * key, const char * file, const char * line, const char * module) -{ - setError (key, ELEKTRA_ERROR_OUT_OF_MEMORY, ELEKTRA_ERROR_OUT_OF_MEMORY_NAME, file, line, module, "Out of memory"); -} - KeySet * elektraErrorSpecification (void) { return ksNew (30, keyNew ("system/elektra/modules/error/specification", KEY_VALUE, "the specification of all error codes", KEY_END), @@ -244,7 +240,7 @@ void elektraTriggerError (const char * nr, Key * parentKey, const char * message } if (strcmp (nr, ELEKTRA_ERROR_OUT_OF_MEMORY) == 0) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, message); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); return; } if (strcmp (nr, ELEKTRA_ERROR_INSTALLATION) == 0) diff --git a/src/plugins/augeas/augeas.c b/src/plugins/augeas/augeas.c index 8985ee2b37f..f6c79ae2c82 100644 --- a/src/plugins/augeas/augeas.c +++ b/src/plugins/augeas/augeas.c @@ -415,7 +415,7 @@ static int saveTree (augeas * augeasHandle, KeySet * ks, const char * lensPath, memoryerror: elektraFree (keyArray); - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Unable to allocate memory while saving the augeas tree"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); return -1; } @@ -432,7 +432,7 @@ int elektraAugeasOpen (Plugin * handle, Key * parentKey) if (ret >= 0) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Unable to allocate memory for a detailed augeas error message"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); return -1; } diff --git a/src/plugins/base64/base64.c b/src/plugins/base64/base64.c index 2f0c7f324ab..41f2ec7caaf 100644 --- a/src/plugins/base64/base64.c +++ b/src/plugins/base64/base64.c @@ -36,7 +36,7 @@ static int unescape (Key * key, Key * parent) char * unescaped = elektraStrDup (&strVal[1]); if (!unescaped) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent); return -1; } keySetString (key, unescaped); @@ -112,7 +112,7 @@ static int decode (Key * key, Key * parent, bool metaMode) else if (result == -2) { // Memory error - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent); return -1; } @@ -138,7 +138,7 @@ static int encode (Key * key, Key * parent, bool metaMode) char * base64 = base64Encode (keyValue (key), (size_t) keyGetValueSize (key)); if (!base64) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent); return -1; } @@ -152,7 +152,7 @@ static int encode (Key * key, Key * parent, bool metaMode) char * newVal = elektraMalloc (newValLen); if (!newVal) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent); elektraFree (base64); return -1; } @@ -192,7 +192,7 @@ static int escape (Key * key, Key * parent) char * escapedVal = elektraMalloc (strValLen + 2); if (!escapedVal) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent); return -1; } diff --git a/src/plugins/conditionals/conditionals.c b/src/plugins/conditionals/conditionals.c index 7989cd595a1..ba622ad8754 100644 --- a/src/plugins/conditionals/conditionals.c +++ b/src/plugins/conditionals/conditionals.c @@ -207,7 +207,7 @@ static CondResult evalCondition (const Key * curKey, const char * leftSide, Comp } if (elektraRealloc ((void **) &compareTo, (size_t) (endPos - rightSide)) < 0) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Out of memory"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); result = ERROR; goto Cleanup; } @@ -226,7 +226,7 @@ static CondResult evalCondition (const Key * curKey, const char * leftSide, Comp if (elektraRealloc ((void **) &lookupName, (size_t) len) < 0) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Out of memory"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); result = ERROR; goto Cleanup; } @@ -251,7 +251,7 @@ static CondResult evalCondition (const Key * curKey, const char * leftSide, Comp } if (elektraRealloc ((void **) &compareTo, (size_t) keyGetValueSize (key)) < 0) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Out of memory"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); result = ERROR; goto Cleanup; } @@ -267,7 +267,7 @@ static CondResult evalCondition (const Key * curKey, const char * leftSide, Comp if (elektraRealloc ((void **) &lookupName, (size_t) len) < 0) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Out of memory"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); result = ERROR; goto Cleanup; } diff --git a/src/plugins/crypto/botan_operations.cpp b/src/plugins/crypto/botan_operations.cpp index e2832856c4c..19c7d4e25e8 100644 --- a/src/plugins/crypto/botan_operations.cpp +++ b/src/plugins/crypto/botan_operations.cpp @@ -66,7 +66,7 @@ static int getKeyIvForEncryption (KeySet * config, Key * errorKey, Key * masterK } if (!saltHexString) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } keySetMeta (k, ELEKTRA_CRYPTO_META_SALT, saltHexString); diff --git a/src/plugins/crypto/gcrypt_operations.c b/src/plugins/crypto/gcrypt_operations.c index 3a0d3233cb4..1f85214b4a2 100644 --- a/src/plugins/crypto/gcrypt_operations.c +++ b/src/plugins/crypto/gcrypt_operations.c @@ -58,7 +58,7 @@ static int getKeyIvForEncryption (KeySet * config, Key * errorKey, Key * masterK } if (!saltHexString) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } keySetMeta (k, ELEKTRA_CRYPTO_META_SALT, saltHexString); @@ -205,7 +205,7 @@ int elektraCryptoGcryHandleCreate (elektraCryptoHandle ** handle, KeySet * confi memset (ivBuffer, 0, sizeof (ivBuffer)); keyDel (key); keyDel (iv); - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } @@ -293,7 +293,7 @@ int elektraCryptoGcryEncrypt (elektraCryptoHandle * handle, Key * k, Key * error kdb_octet_t * output = elektraMalloc (outputLen); if (!output) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); elektraFree (salt); return -1; } @@ -373,7 +373,7 @@ int elektraCryptoGcryDecrypt (elektraCryptoHandle * handle, Key * k, Key * error kdb_octet_t * output = elektraMalloc (payloadLen); if (!output) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } @@ -446,7 +446,7 @@ char * elektraCryptoGcryCreateRandomString (Key * errorKey, const kdb_unsigned_s } if (!encoded) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); } return encoded; } diff --git a/src/plugins/crypto/gpg.c b/src/plugins/crypto/gpg.c index 6afa9ebfccc..81443499373 100644 --- a/src/plugins/crypto/gpg.c +++ b/src/plugins/crypto/gpg.c @@ -116,7 +116,7 @@ static char * genGpgCandidate (Key * errorKey, char * dir, const char * file) char * result = elektraMalloc (resultLen); if (!result) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return NULL; } snprintf (result, resultLen, "%s/%s", dir, file); @@ -146,7 +146,7 @@ static int searchPathForBin (Key * errorKey, const char * bin, char ** result) char * path = elektraMalloc (envPathLen); if (!path) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } memcpy (path, envPath, envPathLen); @@ -196,7 +196,7 @@ int ELEKTRA_PLUGIN_FUNCTION (gpgGetBinary) (char ** gpgBin, KeySet * conf, Key * *gpgBin = elektraMalloc (configPathLen + 1); if (!(*gpgBin)) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } strncpy (*gpgBin, configPath, configPathLen); @@ -237,7 +237,7 @@ int ELEKTRA_PLUGIN_FUNCTION (gpgGetBinary) (char ** gpgBin, KeySet * conf, Key * *gpgBin = elektraStrDup (ELEKTRA_CRYPTO_DEFAULT_GPG2_BIN); if (!(*gpgBin)) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } return 1; @@ -249,7 +249,7 @@ int ELEKTRA_PLUGIN_FUNCTION (gpgGetBinary) (char ** gpgBin, KeySet * conf, Key * *gpgBin = elektraStrDup (ELEKTRA_CRYPTO_DEFAULT_GPG1_BIN); if (!(*gpgBin)) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } return 1; @@ -645,7 +645,7 @@ int ELEKTRA_PLUGIN_FUNCTION (gpgCall) (KeySet * conf, Key * errorKey, Key * msgK // estimated maximum output size = 2 * input (including headers, etc.) if (msgKey && !(buffer = elektraMalloc (bufferSize))) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); closePipe (pipe_stdin); closePipe (pipe_stdout); closePipe (pipe_stderr); diff --git a/src/plugins/crypto/helper.c b/src/plugins/crypto/helper.c index c0da504189f..b3c38816587 100644 --- a/src/plugins/crypto/helper.c +++ b/src/plugins/crypto/helper.c @@ -125,7 +125,7 @@ int ELEKTRA_PLUGIN_FUNCTION (getSaltFromMetakey) (Key * errorKey, Key * k, kdb_o } else if (result == -2) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } else if (result < -2) diff --git a/src/plugins/crypto/openssl_operations.c b/src/plugins/crypto/openssl_operations.c index 3b3c9c32d1c..2a44f1d757d 100644 --- a/src/plugins/crypto/openssl_operations.c +++ b/src/plugins/crypto/openssl_operations.c @@ -73,7 +73,7 @@ static int getKeyIvForEncryption (KeySet * config, Key * errorKey, Key * masterK } if (!saltHexString) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } keySetMeta (k, ELEKTRA_CRYPTO_META_SALT, saltHexString); @@ -223,7 +223,7 @@ int elektraCryptoOpenSSLHandleCreate (elektraCryptoHandle ** handle, KeySet * co { memset (keyBuffer, 0, sizeof (keyBuffer)); memset (ivBuffer, 0, sizeof (ivBuffer)); - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; } @@ -307,7 +307,7 @@ int elektraCryptoOpenSSLEncrypt (elektraCryptoHandle * handle, Key * k, Key * er encrypted = BIO_new (BIO_s_mem ()); if (!encrypted) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); pthread_mutex_unlock (&mutex_ssl); elektraFree (salt); return -1; @@ -433,7 +433,7 @@ int elektraCryptoOpenSSLDecrypt (elektraCryptoHandle * handle, Key * k, Key * er BIO * decrypted = BIO_new (BIO_s_mem ()); if (!decrypted) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); pthread_mutex_unlock (&mutex_ssl); return -1; } @@ -535,7 +535,7 @@ char * elektraCryptoOpenSSLCreateRandomString (Key * errorKey, const kdb_unsigne } if (!encoded) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); } return encoded; } diff --git a/src/plugins/fcrypt/fcrypt.c b/src/plugins/fcrypt/fcrypt.c index e6e4119ce37..c036f8e2e22 100644 --- a/src/plugins/fcrypt/fcrypt.c +++ b/src/plugins/fcrypt/fcrypt.c @@ -295,7 +295,7 @@ static int fcryptEncrypt (KeySet * pluginConfig, Key * parentKey) char * tmpFile = getTemporaryFileName (pluginConfig, keyString (parentKey), &tmpFileFd); if (!tmpFile) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); return -1; } @@ -434,7 +434,7 @@ static int fcryptDecrypt (KeySet * pluginConfig, Key * parentKey, fcryptState * char * tmpFile = getTemporaryFileName (pluginConfig, keyString (parentKey), &tmpFileFd); if (!tmpFile) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); return -1; } @@ -513,7 +513,7 @@ int ELEKTRA_PLUGIN_FUNCTION (open) (Plugin * handle, KeySet * ks ELEKTRA_UNUSED, fcryptState * s = elektraMalloc (sizeof (fcryptState)); if (!s) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); return -1; } diff --git a/src/plugins/gpgme/gpgme.c b/src/plugins/gpgme/gpgme.c index e2ce378bc58..24ec6fd5100 100644 --- a/src/plugins/gpgme/gpgme.c +++ b/src/plugins/gpgme/gpgme.c @@ -163,7 +163,7 @@ static gpgme_key_t * extractRecipientFromPluginConfig (KeySet * config, Key * er { if (!elektraGpgmeKeylistAdd (&list, key)) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); elektraGpgmeKeylistFree (&list); return NULL; } @@ -193,7 +193,7 @@ static gpgme_key_t * extractRecipientFromPluginConfig (KeySet * config, Key * er { if (!elektraGpgmeKeylistAdd (&list, key)) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); elektraGpgmeKeylistFree (&list); return NULL; } @@ -211,7 +211,7 @@ static gpgme_key_t * extractRecipientFromPluginConfig (KeySet * config, Key * er gpgme_key_t * keyArray = elektraMalloc ((list.size + 1) * sizeof (gpgme_key_t)); if (!keyArray) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); elektraGpgmeKeylistFree (&list); return NULL; } @@ -250,7 +250,7 @@ static int transferGpgmeDataToElektraKey (gpgme_data_t src, Key * dst, Key * err buffer = (char *) elektraMalloc (ciphertextLen); if (!buffer) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); returnValue = -1; // failure goto cleanup; } @@ -438,7 +438,7 @@ static int gpgEncrypt (Plugin * handle, KeySet * data, Key * errorKey) } else { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); } gpgme_data_release (ciphertext); gpgme_data_release (input); diff --git a/src/plugins/ini/ini.c b/src/plugins/ini/ini.c index 4494dc5f4de..bc14c933fcd 100644 --- a/src/plugins/ini/ini.c +++ b/src/plugins/ini/ini.c @@ -783,7 +783,7 @@ int elektraIniGet (Plugin * handle, KeySet * returned, Key * parentKey) ELEKTRA_SET_RESOURCE_ERROR (parentKey, "Unable to open the ini file"); break; case -2: - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Memory allocation error while reading the ini file"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); break; default: ELEKTRA_SET_VALIDATION_SYNTACTIC_ERRORF (parentKey, "Could not parse ini file %s. First error at line %d", diff --git a/src/plugins/ipaddr/ipaddr.c b/src/plugins/ipaddr/ipaddr.c index 39bea8501c1..9ed7f92864f 100644 --- a/src/plugins/ipaddr/ipaddr.c +++ b/src/plugins/ipaddr/ipaddr.c @@ -107,7 +107,7 @@ static int validateKey (Key * key, Key * parentKey) } else if (rc == -1) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Out of memory"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); rc = 0; } diff --git a/src/plugins/jni/jni.c b/src/plugins/jni/jni.c index 78ce3e29f05..8182e89cdb5 100644 --- a/src/plugins/jni/jni.c +++ b/src/plugins/jni/jni.c @@ -227,7 +227,7 @@ int elektraJniOpen (Plugin * handle, Key * errorKey) ELEKTRA_SET_INSTALLATION_ERROR (errorKey, "Cannot create Java VM: JNI version error"); return -1; case JNI_ENOMEM: - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Cannot create Java VM: Not enough memory"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); return -1; case JNI_EEXIST: ELEKTRA_SET_RESOURCE_ERROR (errorKey, "Cannot create Java VM: VM already created"); diff --git a/src/plugins/keytometa/keytometa.c b/src/plugins/keytometa/keytometa.c index 15f422b660a..4bf1341e590 100644 --- a/src/plugins/keytometa/keytometa.c +++ b/src/plugins/keytometa/keytometa.c @@ -254,7 +254,7 @@ int elektraKeyToMetaGet (Plugin * handle, KeySet * returned, Key * parentKey ELE if (ret < 0) { elektraFree (keyArray); - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, "Memory allocation failed"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); errno = errnosave; return 0; } diff --git a/src/plugins/lua/lua.cpp b/src/plugins/lua/lua.cpp index ef90b3f9db4..9a3f5525188 100644 --- a/src/plugins/lua/lua.cpp +++ b/src/plugins/lua/lua.cpp @@ -147,7 +147,7 @@ int elektraLuaOpen (ckdb::Plugin * handle, ckdb::Key * errorKey) /* init new lua state */ if ((data->L = lua_newstate (Lua_alloc, NULL)) == NULL) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey, "Unable to create new lua state"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (errorKey); goto error; } diff --git a/src/plugins/xerces/xerces.cpp b/src/plugins/xerces/xerces.cpp index fa7771004dd..490621b4894 100644 --- a/src/plugins/xerces/xerces.cpp +++ b/src/plugins/xerces/xerces.cpp @@ -66,7 +66,7 @@ int elektraXercesGet (Plugin * handle ELEKTRA_UNUSED, KeySet * returned, Key * p } catch (const OutOfMemoryException & e) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, asCStr (e.getMessage ())); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); } catch (const XMLException & e) { @@ -104,7 +104,7 @@ int elektraXercesSet (Plugin * handle ELEKTRA_UNUSED, KeySet * returned, Key * p } catch (const OutOfMemoryException & e) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey, asCStr (e.getMessage ())); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parentKey); } catch (const XMLException & e) { diff --git a/src/plugins/yambi/convert.cpp b/src/plugins/yambi/convert.cpp index fe615338603..6d121bd5727 100644 --- a/src/plugins/yambi/convert.cpp +++ b/src/plugins/yambi/convert.cpp @@ -50,7 +50,7 @@ int addToKeySet (CppKeySet & keySet, CppKey & parent, string const & filename) } else if (status == -2) { - ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent.getKey (), "Parsing failed due to memory exhaustion"); + ELEKTRA_SET_OUT_OF_MEMORY_ERROR (parent.getKey ()); } else if (status == -1) {