[Desc.] Resource leak and null check (regression on safestring.c)
[Issue] Prevent CID 38197~8, 33895~8
gchar *kernel_path = NULL;
kernel_path = (char *)malloc( 512);
if(kernel_path == NULL){
+ g_free(path);
return NULL;
}
memset(kernel_path, 0, 512);
gchar *path = NULL;
path = get_path();
if(path == NULL){
+ g_free(conf_path);
return NULL;
}
int srcsize;
int dstsize;
- srcsize = strlen(src);
- dstsize = strlen(dst);
-
if (!dst || !src) {
return -1;
}
+ srcsize = strlen(src);
+ dstsize = strlen(dst);
+
if ((srcsize == 0) && (dstsize == 0)) {
return 0;
}
int srcsize;
int dstsize;
- srcsize = strlen(src);
- dstsize = strlen(dst);
-
if (!dst || !src) {
return -1;
}
+ srcsize = strlen(src);
+ dstsize = strlen(dst);
+
if ((srcsize == 0) && (dstsize == 0)) {
return 0;
}