+
+/*
+ * Delete a system config value.
+ */
+void CtdlDelConfig(char *key)
+{
+ int key_len = strlen(key);
+
+ if (IsEmptyStr(key)) return;
+
+ /* Delete from the database. */
+ cdb_delete(CDB_CONFIG, key, key_len);
+
+ /* Delete from the in-memory cache */
+ HashPos *Pos = GetNewHashPos(ctdlconfig, 1);
+ if (GetHashPosFromKey(ctdlconfig, key, key_len, Pos)) {
+ DeleteEntryFromHash(ctdlconfig, Pos);
+ }
+ DeleteHashPos(&Pos);
+
+ assert(Pos == NULL); // no memory leaks allowed
+}
+
+
+
+