* Free "times" pointer if it is not returned to the user.
* Free (re)alloc'ed pointers when strdup() fails.
pthread_mutex_unlock (&cache_lock);
if (keys_len == 0)
+ {
+ /* realloc() may have been called for these. */
+ sfree (keys);
+ sfree (keys_time);
+ sfree (keys_interval);
return (0);
+ }
/* Call the "missing" callback for each value. Do this before removing the
* value from the cache, so that callbacks can still access the data stored,
*ret_names = names;
if (ret_times != NULL)
*ret_times = times;
+ else
+ sfree (times);
*ret_number = number;
return (0);