Commit d745b820 by Serge Hallyn

lxclock: fix stupid scope error

parent 8c9c2c6d
...@@ -123,16 +123,16 @@ static char *lxclock_name(const char *p, const char *n) ...@@ -123,16 +123,16 @@ static char *lxclock_name(const char *p, const char *n)
if (ret < 0) { if (ret < 0) {
/* fall back to "/tmp/" $(id -u) "/lxc/" $lxcpath / $lxcname + '\0' */ /* fall back to "/tmp/" $(id -u) "/lxc/" $lxcpath / $lxcname + '\0' */
int l2 = 33 + strlen(n) + strlen(p); int l2 = 33 + strlen(n) + strlen(p);
char *d;
if (l2 > len) { if (l2 > len) {
char *d;
d = realloc(dest, l2); d = realloc(dest, l2);
if (!d) { if (!d) {
free(dest); free(dest);
return NULL; return NULL;
} }
len = l2; len = l2;
dest = d;
} }
dest = d;
ret = snprintf(dest, len, "/tmp/%d/lxc/%s", geteuid(), p); ret = snprintf(dest, len, "/tmp/%d/lxc/%s", geteuid(), p);
if (ret < 0 || ret >= len) { if (ret < 0 || ret >= len) {
free(dest); free(dest);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment