Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/handle.c
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2020-04-13 17:39:35 +1000
committerAllan McRae <allan@archlinux.org>2020-04-13 23:44:46 +1000
commit0eda92c5d4f8810a68066ee72713ffdfa878dd8c (patch)
treef53a8c8730ef5833454b501eccedbfc0dd2e8c43 /lib/libalpm/handle.c
parent1b3289745334ec31507a12b6c54b2883a521543e (diff)
Use STRDUP for error checking in more places
Use STRDUP() over strdup() to catch memory allocation errors. There are still some instances of strdup left, but these are in functions that currently have no error path and would require a larger rework. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r--lib/libalpm/handle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index fc7c1faf..6b19a703 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -105,7 +105,7 @@ int _alpm_handle_lock(alpm_handle_t *handle)
ASSERT(handle->lockfd < 0, return 0);
/* create the dir of the lockfile first */
- dir = strdup(handle->lockfile);
+ STRDUP(dir, handle->lockfile, return -1);
ptr = strrchr(dir, '/');
if(ptr) {
*ptr = '\0';