소스 검색

Free tmp string if dirname fails

master
lostd 10 년 전
부모
커밋
0809871aeb
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. +3
    -1
      noice.c

+ 3
- 1
noice.c 파일 보기

@@ -128,8 +128,10 @@ xdirname(const char *path)
* original string if we lose track of it. */
tmp = xstrdup(path);
p = dirname(tmp);
if (p == NULL)
if (p == NULL) {
free(tmp);
printerr(1, "dirname");
}
/* Make sure this is a malloc(3)-ed string */
p = xstrdup(p);
free(tmp);


||||||
x
 
000:0
불러오는 중...
취소
저장