mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Add implementation of smartlist_add_strdup
Add smartlist_add_strdup(sl, string) - replaces the use of smartlist_add(sl, tor_strdup(string)). Fixes bug 20048.
This commit is contained in:
parent
48d7b69302
commit
b8b8b6b70e
4
changes/bug20048
Normal file
4
changes/bug20048
Normal file
@ -0,0 +1,4 @@
|
||||
o Minor bugfixes:
|
||||
- Implement smartlist_add_strdup() function. Replaces the use of
|
||||
smartlist_add(sl, tor_strdup(str)). Fixes bug 20048.
|
||||
|
@ -3532,6 +3532,17 @@ smartlist_add_vasprintf(struct smartlist_t *sl, const char *pattern,
|
||||
smartlist_add(sl, str);
|
||||
}
|
||||
|
||||
/** Append a copy of string to sl */
|
||||
void
|
||||
smartlist_add_strdup(struct smartlist_t *sl, const char *string)
|
||||
{
|
||||
char *copy;
|
||||
|
||||
copy = tor_strdup(string);
|
||||
|
||||
smartlist_add(sl, copy);
|
||||
}
|
||||
|
||||
/** Return a new list containing the filenames in the directory <b>dirname</b>.
|
||||
* Return NULL on error or if <b>dirname</b> is not a directory.
|
||||
*/
|
||||
|
@ -239,6 +239,7 @@ void smartlist_add_asprintf(struct smartlist_t *sl, const char *pattern, ...)
|
||||
void smartlist_add_vasprintf(struct smartlist_t *sl, const char *pattern,
|
||||
va_list args)
|
||||
CHECK_PRINTF(2, 0);
|
||||
void smartlist_add_strdup(struct smartlist_t *sl, const char *string);
|
||||
|
||||
/* Time helpers */
|
||||
long tv_udiff(const struct timeval *start, const struct timeval *end);
|
||||
|
Loading…
Reference in New Issue
Block a user