summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/opk/write.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opk/write.c b/src/opk/write.c
index 2986ae0..3880552 100644
--- a/src/opk/write.c
+++ b/src/opk/write.c
@@ -509,7 +509,7 @@ opkg_opk_opk_write(struct opkg_opk_opk *opk, const char *file_name)
/* Allocate temporary archive file name buffer. */
opk->temp_file_name =
- malloc(sizeof(file_name) + sizeof("~control.tar.gz"));
+ malloc(strlen(file_name) + strlen("~control.tar.gz") + 1);
if (opk->temp_file_name == NULL) {
ret = OPKG_OPK_ERROR;
goto out4;