[vlc-commits] [Git][videolan/vlc][master] platform: add missing error check
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Fri Dec 31 09:31:04 UTC 2021
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
c95a66ef by Lyndon Brown at 2021-12-31T08:54:03+00:00
platform: add missing error check
- - - - -
2 changed files:
- src/darwin/dirs.m
- src/os2/dirs.c
Changes:
=====================================
src/darwin/dirs.m
=====================================
@@ -147,7 +147,8 @@ char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
return dir;
char *path;
- asprintf(&path, "%s/%s", dir, filename);
+ if (unlikely(asprintf(&path, "%s/%s", dir, filename) == -1))
+ path = NULL;
free(dir);
return path;
}
=====================================
src/os2/dirs.c
=====================================
@@ -143,7 +143,8 @@ char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
return dir;
char *path;
- asprintf(&path, "%s/%s", dir, filename);
+ if (unlikely(asprintf(&path, "%s/%s", dir, filename) == -1))
+ path = NULL;
free(dir);
return path;
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c95a66efd578d762e9ccc4098bae4c5629084d68
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c95a66efd578d762e9ccc4098bae4c5629084d68
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list