1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-12 19:31:53 +00:00
security scan report issue
This commit is contained in:
Hui Zhang (huzhang2) 2018-07-16 16:27:41 +08:00
parent 0fe17c3e34
commit 01ed485cf3
4 changed files with 6 additions and 2 deletions

View file

@ -690,6 +690,7 @@ int SrsServer::acquire_pid_file()
if(errno == EACCES || errno == EAGAIN) {
ret = ERROR_SYSTEM_PID_ALREADY_RUNNING;
srs_error("srs is already running! ret=%#x", ret);
::close(fd);
return ret;
}

View file

@ -71,6 +71,7 @@ int srs_socket_connect(string server, int port, int64_t timeout, st_netfd_t* pst
if(stfd == NULL){
ret = ERROR_ST_OPEN_SOCKET;
srs_error("st_netfd_open_socket failed. ret=%d", ret);
::close(sock);
return ret;
}
@ -94,12 +95,14 @@ int srs_socket_connect(string server, int port, int64_t timeout, st_netfd_t* pst
srs_info("connect ok. server=%s, ip=%s, port=%d", server.c_str(), ip.c_str(), port);
*pstfd = stfd;
::close(sock);
return ret;
failed:
if (stfd) {
srs_close_stfd(stfd);
}
::close(sock);
return ret;
}

View file

@ -169,7 +169,7 @@ string srs_codec_avc_level2str(SrsAvcLevel level)
// 1 = 11 kHz = 11025 Hz
// 2 = 22 kHz = 22050 Hz
// 3 = 44 kHz = 44100 Hz
int flv_sample_rates[] = {5512, 11025, 22050, 44100};
int flv_sample_rates[] = {5512, 11025, 22050, 44100, 0};
// the sample rates in the codec,
// in the sequence header.

View file

@ -652,7 +652,7 @@ int srs_av_base64_decode(u_int8_t* out, const char* in_str, int out_size)
// no sign extension
const u_int8_t *in = (const u_int8_t*)in_str;
unsigned bits = 0xff;
unsigned v;
unsigned v = 0;
while (end - dst > 3) {
BASE64_DEC_STEP(0);