[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Check error from asprintf() correctly for dhcpclass handling.



If asprintf() errors, it returns -1.  Check for that correctly and
return 20 on error.

[rawhide]
---
 loader/net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/loader/net.c b/loader/net.c
index aead300..e7f6c70 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -1170,7 +1170,7 @@ int writeEnabledNetInfo(iface_t *iface) {
             iface->vendorclass = "anaconda";
         } else {
             if (asprintf(&iface->vendorclass, "anaconda-%s %s %s",
-                         kv.sysname, kv.release, kv.machine)) {
+                         kv.sysname, kv.release, kv.machine) == -1 ) {
                 return 20;
             }
         }
-- 
1.6.0.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]