log UPDATE add ERRMEM check macros
diff --git a/src/server_config_ks.c b/src/server_config_ks.c
index 75003ff..9540f3d 100644
--- a/src/server_config_ks.c
+++ b/src/server_config_ks.c
@@ -267,10 +267,7 @@
/* replace the pubkey */
free(key->pubkey_data);
key->pubkey_data = strdup(lyd_get_value(node));
- if (!key->pubkey_data) {
- ERRMEM;
- return 1;
- }
+ NC_CHECK_ERRMEM_RET(!key->pubkey_data, 1);
return 0;
}
@@ -319,10 +316,7 @@
/* replace the privkey */
free(key->privkey_data);
key->privkey_data = strdup(lyd_get_value(node));
- if (!key->privkey_data) {
- ERRMEM;
- return 1;
- }
+ NC_CHECK_ERRMEM_RET(!key->privkey_data, 1);
} else if (op == NC_OP_DELETE) {
free(key->privkey_data);
key->privkey_data = NULL;
@@ -384,10 +378,7 @@
/* replace the cert data */
free(cert->data);
cert->data = strdup(lyd_get_value(node));
- if (!cert->data) {
- ERRMEM;
- return 1;
- }
+ NC_CHECK_ERRMEM_RET(!cert->data, 1);
}
return 0;