]> jfr.im git - irc/gunnarbeutner/shroudbnc.git/commitdiff
Added missing checks for asprintf() in sbnc.cpp.
authorGunnar Beutner <redacted>
Thu, 14 Jul 2011 16:36:46 +0000 (18:36 +0200)
committerGunnar Beutner <redacted>
Thu, 14 Jul 2011 16:36:46 +0000 (18:36 +0200)
src/sbnc.cpp

index 40a31b87af576ffb4bc654cad74fbcb62cb2acfc..76ed45557a438a0552b94e42e6592165f226c776 100644 (file)
@@ -263,7 +263,11 @@ char *sbncFindConfigDir(void) {
                return ConfigPath2;
        }
 
-       asprintf(&ConfigPath, "%s/.sbnc", HomeDir);
+       if (asprintf(&ConfigPath, "%s/.sbnc", HomeDir) < 0) {
+               perror("asprintf failed");
+
+               exit(EXIT_FAILURE);
+       }
 #else
     TCHAR AppDataLocation[MAX_PATH];
     SHGetSpecialFolderPath(NULL, AppDataLocation, CSIDL_APPDATA, FALSE);