Ensure copied is not overwritten by another strdup causing a leak
This commit is contained in:
parent
e7e9d02c9e
commit
04e6422c72
|
@ -915,6 +915,7 @@ int rktio_make_directory(rktio_t *rktio, const char *filename)
|
||||||
/* Make sure path doesn't have trailing separator: */
|
/* Make sure path doesn't have trailing separator: */
|
||||||
len = strlen(filename);
|
len = strlen(filename);
|
||||||
while (len && IS_A_SEP(filename[len - 1])) {
|
while (len && IS_A_SEP(filename[len - 1])) {
|
||||||
|
if (!copied)
|
||||||
copied = MSC_IZE(strdup)(filename);
|
copied = MSC_IZE(strdup)(filename);
|
||||||
copied[--len] = 0;
|
copied[--len] = 0;
|
||||||
filename = copied;
|
filename = copied;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user