if (!gencache_init()) return False;
asprintf(&valstr, CACHE_DATA_FMT, (int)timeout, value);
+ if (!valstr)
+ return False;
+
keybuf.dptr = strdup(keystr);
keybuf.dsize = strlen(keystr)+1;
databuf.dptr = strdup(valstr);
keybuf.dptr = strdup(keystr);
keybuf.dsize = strlen(keystr)+1;
databuf = tdb_fetch(cache, keybuf);
+ SAFE_FREE(keybuf.dptr);
if (databuf.dptr && databuf.dsize > TIMEOUT_LEN) {
char* entry_buf = strndup(databuf.dptr, databuf.dsize);
time_t expiry;
char *key, *value_string;
int i;
+ BOOL ret;
/*
* we use gecache call to avoid annoying debug messages about
* First, store the number of ip addresses and then
* place each single ip
*/
- ipstr_list_make(&value_string, ip_list, num_names);
+ if (!ipstr_list_make(&value_string, ip_list, num_names)) {
+ SAFE_FREE(key);
+ SAFE_FREE(value_string);
+ return False;
+ }
/* set the entry */
- return (gencache_set(key, value_string, expiry));
+ ret = gencache_set(key, value_string, expiry);
+ SAFE_FREE(key);
+ SAFE_FREE(value_string);
+ return ret;
}
break;
case P_LIST:
+ str_list_free(parm_ptr);
*(char ***)parm_ptr = str_list_make(pszParmValue, NULL);
break;