/*
* internal.c: internal data structures and helpers
*
- * Copyright (C) 2007-2011 David Lutterkort
+ * Copyright (C) 2007-2015 David Lutterkort
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
len += strlen(*path) + 1;
if (REALLOC_N(*path, len) == -1) {
FREE(*path);
+ va_end(ap);
return -1;
}
if (strlen(*path) == 0 || (*path)[strlen(*path)-1] != SEP)
seg += 1;
strcat(*path, seg);
} else {
- if ((*path = malloc(len)) == NULL)
+ if ((*path = malloc(len)) == NULL) {
+ va_end(ap);
return -1;
+ }
strcpy(*path, seg);
}
}