summaryrefslogtreecommitdiffstats
path: root/libopkg
diff options
context:
space:
mode:
Diffstat (limited to 'libopkg')
-rw-r--r--libopkg/opkg_state.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libopkg/opkg_state.c b/libopkg/opkg_state.c
index 2cc8594..d83b96b 100644
--- a/libopkg/opkg_state.c
+++ b/libopkg/opkg_state.c
@@ -45,8 +45,7 @@ opkg_set_current_state (opkg_state_t state, const char *data)
free (opkg_state_data);
if (data)
{
- opkg_state_data = malloc (strlen (data));
- strcpy (opkg_state_data, data);
+ opkg_state_data = strdup (data);
}
else
{